home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / skey40.zip / STACKEY.DOC < prev    next >
Text File  |  1991-12-23  |  261KB  |  5,854 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           SSSS    TTTTTT     AA       CCCC   KKK  KK  EEEEEEE  YY  YY   (tm)
  8.          SS  SS   T TT T    AAAA     CC  CC   KK  KK   EE   E  YY  YY
  9.          SSS        TT     AA  AA   CC        KK KK    EE E    YY  YY
  10.           SSS       TT     AA  AA   CC        KKKK     EEEE     YYYY
  11.             SSS     TT     AAAAAA   CC        KK KK    EE E      YY
  12.          SS  SS     TT     AA  AA    CC  CC   KK  KK   EE   E    YY
  13.           SSSS     TTTT    AA  AA     CCCC   KKK  KK  EEEEEEE   YYYY
  14.  
  15.  
  16.  
  17.                                   Version 4.0
  18.  
  19.                                CTRLALT Associates  (R)
  20.  
  21.  
  22.                               _______
  23.                          ____|__     |               (R) 
  24.                       --|       |    |-------------------
  25.                         |   ____|__  |  Association of
  26.                         |  |       |_|  Shareware
  27.                         |__|   o   |    Professionals
  28.                       -----|   |   |---------------------
  29.                            |___|___|    MEMBER
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.       TABLE OF CONTENTS
  37.  
  38.       Chapter I:INTRODUCTION....................................3
  39.          I.1 What It Does.......................................3
  40.          I.2 For the new user...................................4
  41.          I.3 Shareware Considerations...........................6
  42.          I.4 New in Version 4.0................................11
  43.          I.5 New in Version 3.0................................12
  44.          I.6 Files in the STACKEY package......................13
  45.          I.7 Loading and Using STACKEY.........................14
  46.          I.8 HELP!!............................................16
  47.          I.9 Errorlevel........................................16
  48.       Chapter II:PLACING KEYSTROKES IN THE BUFFER..............18
  49.          II.1 Stacking text....................................18
  50.          II.2 Two-character Codes..............................18
  51.          II.3 Status Toggles...................................22
  52.          II.4 Prompt metastrings...............................22
  53.          II.5 Decimal and Hex Codes............................23
  54.          II.6 Invoking special programs and keystrokes.........24
  55.          II.7 Simulating depression of shift keys..............26
  56.          II.8 Stacking real time beeps.........................27
  57.          II.9 Popup messages...................................27
  58.          II.10 Sending to standard output......................27
  59.          Appendix 1 to Chapter II. Two character codes.........28
  60.          Appendix 2 to Chapter II...SENDing to STDOUT..........31
  61.       Chapter III:COMMANDS TO THE RESIDENT PORTION.............37
  62.          III.1 Overview........................................37
  63.          III.2 Repeats.........................................37
  64.          III.3 Delays and the Resident Until...................38
  65.          III.4 Scanning........................................40
  66.          III.5 The phony keystroke.............................42
  67.          III.6 Hotkeys.........................................43
  68.          III.7 Pauses for keystrokes...........................45
  69.          III.8 Multiple STACKEY commands.......................45
  70.          III.9 Patient, impatient and smart processing.........46
  71.          III.10 Flushing and Quitting..........................48
  72.          III.11 Enlarging the Buffer...........................49
  73.          III.12 The SKRES program..............................50
  74.          III.13 Test mode......................................51
  75.          III.14 Continue mode..................................51
  76.          III.15 Pushing, popping and querying the flags........52
  77.       Chapter IV:SETTING COLORS................................53
  78.          IV.1 Color Basics: Introduction.......................53
  79.          IV.2 Color Basics: Graphics modes.....................53
  80.          IV.3 Color Basics: CGA color choices..................54
  81.          IV.4 Setting colors on the CGA........................55
  82.          IV.5 Color Basics: EGA color slots and palettes.......57
  83.          IV.6 Color Basics: EGA color labelling................57
  84.          IV.7 Color Basics: EGA borders........................59
  85.          IV.8 Color Basics: EGA hardware considerations........59
  86.          IV.9 Setting colors on the EGA or VGA.................60
  87.          IV.10 Setting permanent colors on the EGA/VGA.........62
  88.          IV.11 Controlling the blinking bit....................63
  89.  
  90.  
  91.  
  92.       Chapter V:UTILITIES MODE.................................65
  93.          V.1 Overview of Utilities Mode........................65
  94.          V.2 Waits.............................................67
  95.          V.3 Switching Monitors and Ports......................70
  96.          V.4 Turning off PrintScreen...........................70
  97.          V.5 Mode, Lines and Cursor Control....................71
  98.          V.6 Beeps.............................................73
  99.          V.7 Screen dumps......................................73
  100.          V.8 Rebooting.........................................74
  101.          V.9 Lock Toggles......................................74
  102.          V.10 The Halt Command.................................75
  103.          V.11 Pause for input..................................75
  104.       Chapter VI:ADVANCED TOPICS...............................77
  105.          VI.1 Keyboard basics: interupts.......................77
  106.          VI.2 Keyboard basics: The buffer and BIOS data area...79
  107.          VI.3 Keyboard basics: Int 9 processing................80
  108.          VI.4 Keyboard basics: int 16/DOS service 8............82
  109.          VI.5 Keyboard Basics: How other programs work.........84
  110.          VI.6 Keyboard basics: How STACKEY works (or doesn't)..84
  111.          VI.7 Inline: Syntax...................................87
  112.          VI.8 External: Syntax.................................88
  113.          VI.9 Inline examples..................................89
  114.          VI.10 STACKEY's API...................................91
  115.       Chapter VII:ASSOCIATED PROGRAMS..........................93
  116.          VII.1 FILEKEY.........................................93
  117.          VII.2 SKREC and SKGET.................................94
  118.          VII.3 EGAPAL and VGAPAL...............................97
  119.          VII.4 Demonstration BATch files.......................98
  120.       Chapter VIII:MISCELLANY.................................100
  121.          VIII.1 Usage notes...................................100
  122.          VIII.2 Also by the same authors......................102
  123.          Appendix to Chapter VIII.............................104
  124.  
  125.  
  126.  
  127.                              Chapter I:INTRODUCTION
  128.  
  129.       FIRST A WORD FROM OUR SPONSOR: THIS IS NOT FREE SOFTWARE.  IF YOU
  130.       CONTINUE TO USE IT AFTER AN INITIAL 30 DAY TRIAL PERIOD, YOU MUST
  131.       REGISTER; PLEASE SEE SECTION I.3.  THANK YOU.
  132.  
  133.  
  134.       I.1 What It Does
  135.  
  136.             STACKEY, a utility from the makers of CTRLALT, will
  137.       automatically place keystrokes in your keyboard buffer.  It is
  138.       intended for use in connection with BATch files.  Here is a typical
  139.       example of a BATch file "lot.bat" for use with 1-2-3 using STACKEY:
  140.             stackey W18 CR"/FR%1.wk1" CR
  141.             123
  142.       Entering "lot mysht" at the DOS command line starts the BATch
  143.       file with mysht as %1.  STACKEY has the command line passed to it
  144.       by the BATch processor with %1 already replaced by mysht.  Thus
  145.       STACKEY places in the keyboard buffer the text: "/FRmysht.wk1"
  146.       followed by a carriage return.  The initial W18 tells STACKEY to
  147.       pause about 1 second to allow 123 to load.  If it weren't there 123
  148.       would happily remove the keystrokes from the buffer before allowing
  149.       any input.  These characters wait in the buffer until a program
  150.       requests keyboard input.  The BATch file then loads 123 which
  151.       requests input and gets it from STACKEY.  /FR calls up a dialog to
  152.       retrieve a worksheet and %1.wk1 followed by a CR loads that
  153.       worksheet.  The CR after the W18 will banish the opening logo
  154.       screen in those versions with an opening logo.
  155.  
  156.             And this example hardly uses the power of STACKEY: you can
  157.       stack any function key or legal Alt-key combination; you can even
  158.       stack today's date or the current directory name.  You can stack
  159.       commands to turn the Num Lock state on and off.  You can stack
  160.       commands to set colors on the CGA and remap colors on the EGA or VGA.
  161.       You can stack a PrtSc.  You can stack commands to call up SIDEKICK,
  162.       SIDEKICK PLUS or any other program that pops up on pairs of shifts.
  163.       You can invoke CTRLALT PLUS, CAROUSEL or DESQVIEW.  STACKEY has
  164.       numerous methods for controlling the flow of a STACKEY "script".  You
  165.       can put delays in or have STACKEY delay its playback until a given
  166.       message appears on the screen or you can have script playback pause
  167.       until you hit a key.  You can pause playback and later restart it with
  168.       appropriate hotkeys and even flush STACKEY's buffer that way.
  169.       STACKEY scripts can even branch depending on what hot key is hit or
  170.       what message appears on the screen.
  171.  
  172.             Despite its power, ease of use is an important part of
  173.       STACKEY.  Rather than cryptic codes for keys like F1, you need only
  174.  
  175.  
  176.       Chapter I:INTRODUCTION                                      Page 3
  177.  
  178.  
  179.  
  180.  
  181.                         Documentation for STACKEY, Version 4.0 
  182.  
  183.  
  184.       use F1.  There is even a recorder which you can use to make batch
  185.       file fragments with the keystrokes you want.
  186.  
  187.             STACKEY also has a utilities mode allowing you to use it to
  188.       replace lots of little utilities that switch monitors or ports,
  189.       restore or change the cursor or even reboot your machine. STACKEY
  190.       comes with a second program BATUTIL, described in a separate manual
  191.       with which you can manipulate your environment or get input in BATch
  192.       files.
  193.  
  194.             Finally STACKEY has a special mode of interest to programmers
  195.       giving you access STACKEY's insides, allowing you place inline code
  196.       in the middle of a STACKEY script.
  197.  
  198.             And STACKEY does its magic with only about 1.7K of resident
  199.       code (with the default buffer size).
  200.  
  201.             For a quick summary of what STACKEY can do, you can call up
  202.       help any time you are at the DOS command line with the command
  203.             stackey ?
  204.       (see the HELP!! Section I.8 below) or you can consult the quick
  205.       summary at the end of the documentation.
  206.  
  207.  
  208.       I.2 For The New User
  209.  
  210.             STACKEY is a powerful package which has many features that
  211.       you won't want to use too often.  For that reason the manual is
  212.       long but many parts can be skipped when you first start using the
  213.       program.  For the basic stacking commands, you'll want to read the
  214.       first three sections of Chapter II after reading the next section.
  215.       After that, you can be off and running.  If you want to use
  216.       utilities mode, you'll need to read Chapter V and if you want to set
  217.       colors with STACKEY, you'll need Chapter IV.  This latter chapter
  218.       is long because of the EGA color tutorial which is included.  If
  219.       you have a CGA, you should only read the first four sections.  If
  220.       you've been confused when hearing about int 16H and int 9, you might
  221.       look at the keyboard basics parts of Chapter VI.
  222.  
  223.             While STACKEY has numerous options to change the way it
  224.       works, typically set and changed with /../ instructions on the
  225.       command line, we have set the defaults to be the most reasonable.
  226.       Thus, you need not worry about these questions unless you find
  227.       yourself in a situation where you wished STACKEY worked differently
  228.  
  229.  
  230.       Chapter I:INTRODUCTION                                      Page 4
  231.  
  232.  
  233.  
  234.  
  235.                         Documentation for STACKEY, Version 4.0 
  236.  
  237.  
  238.       in order to properly interface some particular application program.
  239.       You may be able to tell it to act in an appropriate way.
  240.  
  241.             A summary of the STACKEY commands can be obtained by typing
  242.               stackey ?
  243.  
  244.             If you obtained a registered version of STACKEY/BATUTIL
  245.       directly from Support Group, you'll find directions for installing
  246.       the program in the readme.com program.  The files on diskette are
  247.       in self compressed archives prepared with the Lharc program.  We
  248.       thank Yoshi for writing this program and allowing its use.  If you
  249.       are a less advanced user, you'll want to run the batch file
  250.       INSTHARD.BAT to install BATUTIL and STACKEY on your hard disk or if
  251.       you have only two floppies, use INSTFLOP.BAT.  The hard disk
  252.       automated installation places the programs in the directories
  253.       C:\stackey and C:\batutil.  It requires roughly 700K of free disk
  254.       space including the doc files which you won't need if you are
  255.       registered and have the printed docs.  INSTFLOP requires that you
  256.       have four blank but formatted floppy diskettes handy.  Both
  257.       programs only run from the A: drive.
  258.  
  259.             More sophisticated users may wish to do the installation by
  260.       hand to control the directories where the programs live (they can
  261.       be anywhere although you may want them on your path).  Go to the
  262.       directory you want STACKEY, place the distribution diskette in
  263.       drive A and run
  264.             A:skexe
  265.       and
  266.             A:skdoc
  267.       Then go to the directory you want BATUTIL and run
  268.             A:buexe
  269.       and
  270.             A:budoc
  271.       With floppies each command should be issued with a fresh floppy in
  272.       drive B.
  273.  
  274.             If you got your trial version from a BBS or disk vendor,
  275.       there directions for installation may be different.  Basically you
  276.       want to unpack any archives.  You can then run the programs
  277.       directly.
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.       Chapter I:INTRODUCTION                                      Page 5
  285.  
  286.  
  287.  
  288.  
  289.                         Documentation for STACKEY, Version 4.0 
  290.  
  291.  
  292.       I.3  Shareware Considerations
  293.  
  294.             The STACKEY package consisting of STACKEY, FILEKEY, SKREC,
  295.       SKGET  and EGA/VGAPAL were developed by Barry Simon and Richard
  296.       Wilson and is copyright, 1986-91 by us.  Unlike versions 1.x and 2.x
  297.       which were copyrighted but free, this version, like version 3.x, is
  298.       shareware.  You have a 30 day trial period from the time that you
  299.       first use the program to see if it meets your needs.  If you
  300.       continue to use it after that time you are required to pay a
  301.       registration fee not as a contribution but because you are getting
  302.       use out of our program.  Shareware is dedicated to the idea that
  303.       users are best served by a chance to fully try out something as
  304.       complex and individualistic as software before they buy it and that
  305.       authors are served by an ethic that encourages wide copying for
  306.       trial runs.  But in order for the system to work you need to respect
  307.       the trust that we show in you and register if you continue to use
  308.       our program.   With the release of this shareware version, we will
  309.       no longer support earlier versions of STACKEY.
  310.  
  311.             Registration fees are as follows:
  312.               License to STACKEY & BATUTIL with printed docs        $49
  313.               Upgrade to version 3.0 registered users               $25
  314.       All registrations will get you the printed documentation and the
  315.       latest version on disk.  The printed documentation is essentially
  316.       identical to the documentation on disk.   In addition, there is a $4
  317.       shipping and handling fee for registrations in the US and Canada and
  318.       $13 outside the US/Canada (the package is sent via Air Freight).
  319.       These are the fees for our US registration point.  See discussion of
  320.       Australian and British registration points below.
  321.  
  322.             You may register by phoning or writing (9AM-5PM Eastern time)
  323.             Support Group, Inc.
  324.             Lake Technology Park
  325.             PO Box 130
  326.             McHenry, MD 21541
  327.             1(800)872-4768    (1-800-USA-GROUP)
  328.             1(301)387-4500
  329.             FAX 1(301)387-7322
  330.       Visa, Mastercard, Discover and American Express are accepted.
  331.       Registrations may also be sent to support group via their Compuserve
  332.       mailbox Support Group Orders 74020,10.
  333.  
  334.             Users in Australia and New Zealand may instead prefer to use
  335.       Budgetware as a registration point.  They take credit cards and the
  336.  
  337.  
  338.       Chapter I:INTRODUCTION                                      Page 6
  339.  
  340.  
  341.  
  342.  
  343.                         Documentation for STACKEY, Version 4.0 
  344.  
  345.  
  346.       price inclusive of shipping through them is A$79 (Australian
  347.       dollars).  You can contact them at
  348.             Budgetware
  349.             9 Albermarle Street
  350.             Newtown  NSW 2042
  351.             Australia
  352.             (02) 519-4233 [outside Australia +61 2 519-4233]
  353.             FAX (02) 516-4236 [International +61 2 516 4236]
  354.  
  355.             Users in the United Kingdom or Europe are encouraged to
  356.       register and receive support from
  357.             The Thompson Partnership
  358.             Church Croft
  359.             Bramshall, Uttoxeter
  360.             Staffordshire, ST14 5DE England
  361.             +44 (0)889 564601
  362.             FAX +44 (0)889 563219
  363.       
  364.       Support for users that register with them is available through them
  365.       or on Compuserve either on Ctrlalt's section (on PCVENA) or on the
  366.       Thompson Partnership section (on UKSHARE).   The price for
  367.       registration with them is 49 pounds inclusive of shipping, VAT and
  368.       any duties.
  369.  
  370.             Registration gives you the right to use any version of STACKEY
  371.       and BATUTIL with a major version number of 4.  If there is a version
  372.       5, an update fee may be required.  In addition to the thirty day
  373.       trial period, you may return the disks (and printed documentation)
  374.       for a full refund if you are not totally satisfied for a period of
  375.       90 days after initial registration.  You have the choice of one of
  376.       two license terms: "use like a book" OR a single user license.  The
  377.       former allows you to place copies of this software on as many
  378.       machines as you wish so long as there is NO CHANCE that more than
  379.       one copy of STACKEY will be loaded into any of the machine's
  380.       memories at one time.  The latter allows you to place copies on all
  381.       machines for which YOU are the principal user even if there is a
  382.       chance that OCCASIONALLY more than one copy is in use (for example,
  383.       if you use STACKEY on a office machine while a family member might
  384.       OCCASIONALLY use a copy on a home machine at the same time).
  385.  
  386.       This 800 number is for orders only.  Registered users may obtain
  387.       support in several ways:
  388.             - unlimited free support by writing to
  389.                  CTRLALT Associates
  390.  
  391.  
  392.       Chapter I:INTRODUCTION                                      Page 7
  393.  
  394.  
  395.  
  396.  
  397.                         Documentation for STACKEY, Version 4.0 
  398.  
  399.  
  400.                  Suite 133
  401.                  260 South Lake Ave.
  402.                  Pasadena, CA 91101
  403.             - unlimited free support on Compuserve.  Simon has a
  404.                 Compuserve number [76004,1664].  CTRLALT Associates
  405.                 has its own Compuserve support area: Section 12 of
  406.                 PCVENDOR FORUM A.  After logging onto Compuserve,
  407.                     GO PCVEN
  408.                 will take you to this forum.  In addition to asking
  409.                 questions, you will be able to download the latest
  410.                 version and various sample files, tips, etc.  You can also
  411.                 reach us on the IBMSYS forum and on the UTILITIES forum of
  412.                 PCMAGNET.  For general discussions of shareware issues,
  413.                 you can GO SHAREWARE and leave messages in Section 2.
  414.             - You can also reach Simon via internet by using the
  415.                 Internet/Compuserve connection.  Send messages on internet
  416.                 to
  417.                     76004.1664@compuserve.com
  418.             - We have made arrangements for 900 number support.  There is
  419.                  a $2/minute charge for calling the 900 number (initial 24
  420.                  secs is free).  This support is offered by Advanced
  421.                  Support Group (ASG) in cooperation with Ctrlalt
  422.                  Associates.  (Note: there is no connection between
  423.                  Support Group and Advanced Support Group.)  ASG's number
  424.                  is 1-900-884-3578
  425.             - You can also get support from ASG via at 1-314-256-3130 with
  426.                  charges of $1.75 minute ($10 minimum) to VISA or
  427.                  MASTERCARD.
  428.  
  429.             CTRLALT Associates is happy to offer a free Compuserve signup
  430.       kit including a $15 credit.  Details are provided with your
  431.       registration kit.  This offer is dependent on its continued
  432.       availability from the Compuserve Information service.
  433.  
  434.             We're glad to hear comments, suggestions about enhancements,
  435.       as well as complaints, incompatibilities and bugs.  Suggestions for
  436.       enhancements would be especially welcome.  For example, we added
  437.       utilities mode in going from version 1.0 to version 2.0 in response
  438.       to a request to allow a reboot command.  You can find the version
  439.       of STACKEY by using the DOS command "type STACKEY.COM" or by
  440.       passing a /?/ to STACKEY on the command line.
  441.  
  442.             Consultant's license: With version 3.0, we offered a special
  443.       consultant's license.  This offer has been discontinued although we
  444.  
  445.  
  446.       Chapter I:INTRODUCTION                                      Page 8
  447.  
  448.  
  449.  
  450.  
  451.                         Documentation for STACKEY, Version 4.0 
  452.  
  453.  
  454.       do offer a consultant's upgrade to those who purchased this earlier
  455.       offer.  If you have a version 3.0 consultant's license you should
  456.       have received a letter from us offering the upgrade; if not consult
  457.       Ctrlalt Associates.
  458.  
  459.             Volume discounts start at 5 copies and sitewide licenses at
  460.       100 copies according to the following:
  461.                   5-10 copies:           $44 net
  462.                   11-25 copies:          $40 net
  463.                   26 or more copies:     $35 net
  464.                   sitewide license to 100 copies:   $ 2,500
  465.                   sitewide license to 200 copies:   $ 4,500
  466.                   sitewide license to 1000 copies: $ 10,000
  467.       Sitewide licenses comes with 20 copies of the manuals with
  468.       additional manual sets available for a nominal fee.  For other
  469.       numbers, consult Ctrlalt Associates.
  470.  
  471.             BATUTIL and STACKEY are not normally sold unbundled but only
  472.       together.  However, if you have a specialized use of only one
  473.       program on a network or site with at least 500 work stations,
  474.       special arrangements are possible; consult Ctrlalt Associates.
  475.  
  476.             Non-US users are asked, if possible, to pay via credit card.
  477.       Non US/Canadian users are asked to note the $13 shipping fee.
  478.  
  479.             If you like the program, please give it to your friends, place
  480.       it on bulletin boards and otherwise spread it around.  We explicitly
  481.       allow TRIAL use of it privately and in a commercial environment.
  482.       You may give it away, but you may not charge for it or include it
  483.       with commercial software without our permission.  Two exceptions are
  484.       made - first for not-for profit user groups and secondly, for
  485.       shareware software distributors who are approved shareware
  486.       distributors of the Association of Shareware Professionals, an
  487.       organization to which both Wilson and Simon belong.  Those
  488.       interested in contacting ASP to become approved distributors should
  489.       write for an application to
  490.             Executive Director
  491.             Association of Shareware Professionals
  492.             545 Grover Rd.
  493.             Muskegon, MI 49442
  494.       Vendors may only distribute the full BATUTIL/STACKEY package which
  495.       archived fits on a single 360K diskette if the online help is not
  496.       included; see vendor.doc.
  497.  
  498.  
  499.  
  500.       Chapter I:INTRODUCTION                                      Page 9
  501.  
  502.  
  503.  
  504.  
  505.                         Documentation for STACKEY, Version 4.0 
  506.  
  507.  
  508.             This program is produced by a member of the Association of
  509.       Shareware Professionals (ASP).  ASP wants to make sure that the
  510.       shareware principle works for you. If you are unable to resolve a
  511.       shareware-related problem with an ASP member by contacting the
  512.       member directly, ASP may be able to help. The ASP Ombudsman can
  513.       help you resolve a dispute or problem with an ASP member, but does
  514.       not provide technical support for members' products. Please write
  515.       to the ASP Ombudsman at 545 Grover Road, Muskegon, MI 49442.
  516.       Compuserve message via easyplex to ASP Ombudsman 70007,3536.
  517.  
  518.             STACKEY is warranted for no particular purpose.  While we
  519.       have tried to make the program bug free, no software can be
  520.       guaranteed to be free of bugs.  Due to the complex nature of
  521.       computer software CTRLALT ASSOCIATES does not warrant that the
  522.       licensed Software is completely error-free, will operate without
  523.       interruption, or is compatible with all equipment and software
  524.       configurations.  Repair, replacement or refund, at the option of
  525.       the CTRLALT ASSOCIATES, is the exclusive remedy of the customer, in
  526.       the event of a defect.  By using this program, you accept it AS IS
  527.       and agree that we will NOT be held responsible for any damages
  528.       including but not limited to consequential damages or loss of data.
  529.       This includes damages caused by problems of which CTRLALT
  530.       Associates is already aware.  We will attempt to correct any bug
  531.       which is pointed out to us.  Registered users are entitled to use
  532.       bug fixes while still numbered 4.xx.  We do not intend to support
  533.       Version 4.xx once a Version 5.xx is available and you may need to
  534.       pay an upgrade fee to a new version if there are any bug fixes made
  535.       once Version 5.xx is available.  You may ask for a full refund of
  536.       your registration for a period up to 90 days after you register but
  537.       only if you return the program package sent registered users and
  538.       agree to destroy any copies of BATUTIL and STACKEY in your
  539.       possession and cease using the programs.  While we have attempted
  540.       to make this documentation as clear as possible, we cannot
  541.       guarantee that there will not be misunderstanding or user error.
  542.  
  543.             We specifically exclude any warranties, EXPRESS OR IMPLIED,
  544.       including the IMPLIED WARRANTIES OF MERCHANTABILITY or FITNESS FOR
  545.       A PARTICULAR PURPOSE.   SOME STATES DO NOT ALLOW THE IMPLIED
  546.       WARRANTIES TO BE EXCLUDED.  CONSULT A LAWYER TO SEE WHETHER OR NOT
  547.       THE ABOVE EXCLUSIONS APPLY TO YOU IN YOUR STATE.
  548.  
  549.             This documentation, the programs and source code for the
  550.       associated programs STACKEY, FILEKEY, SKREC, SKGET, EGAPAL, VGAPAL
  551.       and the demonstration BATch files COLOR, SEECOLOR, CGACOLOR, and
  552.  
  553.  
  554.       Chapter I:INTRODUCTION                                     Page 10
  555.  
  556.  
  557.  
  558.  
  559.                         Documentation for STACKEY, Version 4.0 
  560.  
  561.  
  562.       SOUNDS are copyright by Barry Simon and Richard M. Wilson, 1986 -
  563.       1991, all rights reserved.
  564.  
  565.             The following may be trademarked names: Turbo Pascal, Reflex
  566.       and Sidekick by Borland International, Newfont by Mark Horvatich,
  567.       CED and PCED by the Cove Software Group, Fansi Console by Hersey
  568.       Microcomputing, Software Carousel by Softlogic, IBM by IBM,
  569.       Ultravision by Personics, Codeview by Microsoft, Quikbuf by Intel,
  570.       Frieze by Zsoft, List by Vern Buerg, Move'em and 386Max by
  571.       Qualitas, Qemm, Qram and DesqView by Quarterdeck, Pizazz Plus by
  572.       Applications Technology, Tesseract by Innovative Data Concepts,
  573.       123 by Lotus Development Corporation and Bradford by Concom.
  574.       BATUTIL and STACKEY are trademarks and CTRLALT a registered
  575.       trademarks of Ctrlalt Associates.
  576.  
  577.  
  578.       I.4 New in Version 4.0
  579.  
  580.             Here are the major new features in this version:
  581.             - there is a script recorder.  This is a separate resident
  582.                  program you only need to load when you want to record a
  583.                  script.  A companion program takes the script recorded in
  584.                  memory and writes it to a file either in a format
  585.                  suitable for inclusion in batch files using STACKEY or in
  586.                  a FILEKEY format.
  587.             - the string that a scan command searches for can now be
  588.                  enclosed in ".." as an alternate to (..).  This allows
  589.                  scans to include the characters ()<> and |.
  590.             - there is now a wildcard character for scan string (ASCII
  591.                  168, the ¿ character)
  592.             - the SC and SS san commands have been supplemented by a SJ
  593.                  (Scan Jump) and SU (Scan jump qUietly) commands while
  594.                  will scan for several strings on the screen and jump to a
  595.                  label in the script depending on which string is found
  596.             - the WS wait for a specific key command has been supplemented
  597.                  by a WJ (Wait Jump) command which waits for one of
  598.                  several different keys and jumps to a label in the script
  599.                  depending on which key is hit
  600.             - there is now a resident version of the UNtil command.  That
  601.                  is a command which will pause a STACKEY script until a
  602.                  fixed time.
  603.             - there is now a flag to track whether $E and $d use the
  604.                  American or European convention on dates
  605.  
  606.  
  607.  
  608.       Chapter I:INTRODUCTION                                     Page 11
  609.  
  610.  
  611.  
  612.  
  613.                         Documentation for STACKEY, Version 4.0 
  614.  
  615.  
  616.       I.5 New in Version 3.0
  617.  
  618.             If you have been using version 2.0 of STACKEY here are some
  619.       of the new features from version 3.0 carried over to this version:
  620.             -  You can now pause playback (while allowing other programs
  621.                 to run in the foreground) until a stated character string
  622.                 appears at a given place on the screen or until it
  623.                 appears at the current cursor position.  To remind you
  624.                 that this scan mode is on, the cursor will blink.  As an
  625.                 alternative, you can scan "silently", that is with this
  626.                 visual cue not implemented.
  627.             -  You can simulate depressing any set of shift keys for a user
  628.                 specifiable number of clock ticks.  This will allow
  629.                 popping up of SIDEKICK, SIDEKICK PLUS, PRIMETIME and many
  630.                 other programs.
  631.             -  You can load the resident part of STACKEY in high memory
  632.                 with 386max or Qemm.
  633.             -  You can invoke CTRLALT PLUS.
  634.             -  You can swap Carousel partitions or simulate the hitting
  635.                 of the Desq key in DesqView.  You can also invoke any TSR
  636.                 which conforms to the Tesseract standard.
  637.             -  You can send STACKEY text strings and control codes to
  638.                 standard output rather than the keyboard replacing the
  639.                 need for a separate SEND program.
  640.             -  STACKEY now has four hot keys which allow you to talk to
  641.                 the resident part from within other programs.  One will
  642.                 stop playback and flush the buffer, one will pause
  643.                 playback until the third restart playback hotkey is hit,
  644.                 and one will cancel active scans. You can also pause a
  645.                 script to await the restart playback key.  These keys can
  646.                 be changed from the DOS command line.
  647.             -  You can insert beeps and popup messages into STACKEY
  648.                 scripts.
  649.             -  For people who understand assembly language programming
  650.                 you can insert inline code or external files into a
  651.                 STACKEY script.  This will allow others to provide custom
  652.                 routines to you even if you don't understand assembly
  653.                 code.
  654.             -  STACKEY now comes with a stand alone program BATUTIL which
  655.                 gives you considerable control over batch files and over
  656.                 the DOS environment.
  657.             -  The EGA color support added in STACKEY 2.0 has been extended
  658.                 to VGAs and to users of Ultravision.
  659.             -  More informative error messages in response to syntax errors.
  660.  
  661.  
  662.       Chapter I:INTRODUCTION                                     Page 12
  663.  
  664.  
  665.  
  666.  
  667.                         Documentation for STACKEY, Version 4.0 
  668.  
  669.  
  670.       I.6 Files in the STACKEY package
  671.  
  672.       There are eight executable programs
  673.             STACKEY.COM    -    The basic program
  674.             SKRES.COM      -    Version for special loading; see Section
  675.                                   III.11
  676.            *FILEKEY.COM    -    Program to send input to STACKEY's stack
  677.                                   from a file
  678.             EGAPAL.COM     -    Program to allow STACKEY to control
  679.                                   permanent palettes on the EGA
  680.             VGAPAL.COM     -    Program to allow STACKEY to control
  681.                                   permanent palettes on the VGA
  682.             BOXES.COM      -    Small program for the demonstration BATch
  683.                                   file CGACOLOR.BAT
  684.             SKREC.COM      -    Program to record STACKEY scripts in
  685.                                   memory
  686.             SKGET.COM      -    Program to take a macro recorded by SKREC
  687.                                   store in a file in STACKEY or FILEKEY
  688.                                   format
  689.  
  690.       four demonstration BATch files
  691.             CGACOLOR.BAT   -    Demonstrates STACKEY's color commands for
  692.                                   the CGA
  693.             COLOR.BAT      -    Demonstrates STACKEY's color commands for
  694.                                   the EGA by displaying all 64 colors;
  695.                                   use a parameter to indicate the time
  696.                                   between color changes in half second
  697.                                   units; e.g. "color 3" would give 1.5
  698.                                   second change times
  699.             SEECOLOR.BAT   -    Allows you to see any color or colors
  700.                                   supported on the EGA by typing in their
  701.                                   numbers or color patterns; e.g.
  702.                                   "seecolor 14" or "seecolor RrGgB" or
  703.                                   "seecolor 23 42"
  704.             SOUNDS.BAT     -    Illustrates the {BEEP} command
  705.  
  706.       ten files demonstrating the STACKEY external interface:
  707.            *FLASH.BIN      -    External code to flash the screen
  708.            *FLASH.ASM      -    Source for flash.bin
  709.            *FLUSH.BIN      -    External code to reenable the keyboard
  710.                                   and flush the buffer
  711.            *FLUSH.ASM      -    Source for flush.bin
  712.            *MAKEMESS.ASM   -    Shell for making popup yes no messages
  713.            *SAMPLE.MSG     -    A sample external made with MAKEMESS
  714.  
  715.  
  716.       Chapter I:INTRODUCTION                                     Page 13
  717.  
  718.  
  719.  
  720.  
  721.                         Documentation for STACKEY, Version 4.0 
  722.  
  723.  
  724.            *GAVOTTE.BIN    -    High class music external file
  725.            *MONTEV.BIN     -    Another high class music external file
  726.            *POP.BIN        -    A less high class music external file
  727.            *MUSIC.ASM      -    Source for music files
  728.       (See Section VI.9 for more on these samples).
  729.  
  730.       and the help files
  731.            *STACKEY.HLP    -    Basic Help file
  732.  
  733.             Because of our desire to keep the basic files on a single disk
  734.       and to keep download time low, we are encouraging distribution of a
  735.       'small' shareware version without the starred files. If you got
  736.       a version without this file and want it for evaluation, it can be
  737.       downloaded from our support section of Compuserve as SKREST.EXE
  738.       (section 12 of PCVENA) or gotten from many disk vendors including
  739.       PBS (1-800-426-3475).  They will send you a disk with the STACKEY
  740.       and BATUTIL help files for $5 including S&H.  If you upload this
  741.       program to a BBS, please keep STACKEY.HLP as a separate file.
  742.  
  743.             In addition, there are the files associated with BATUTIL
  744.       discussed in the BATUTIL documentation.
  745.  
  746.             While these programs are the package and may be distributed as
  747.       such, the original disks from CTRLALT Associates come with the files
  748.       in compressed format.  The file README.COM on the distribution
  749.       disk will explain how to install the programs.  You cannot just
  750.       use the copy command.  If you got them from another source, that
  751.       source may have used another packing method.
  752.  
  753.  
  754.       I.7 Loading and Using STACKEY
  755.  
  756.             The first time that STACKEY is invoked, it loads a small
  757.       resident portion which becomes permanently resident taking about
  758.       1.5 kilobyte of RAM for code plus whatever buffer size you choose.
  759.       By default the buffer size is 128 'keystrokes' or 256 bytes.  This
  760.       can be changed; see Chapter III - indeed many of the new features
  761.       takes 3-10 keystrokes of buffer space and some considerably more so
  762.       you may want a larger buffer.  It displays the message:
  763.             Resident part of STACKEY now in place.
  764.       and proceeds to read its command line.  At later times, STACKEY
  765.       will find itself in memory and only read its command line.  If you
  766.       are using a hardware or software protocol that allows loading in
  767.       high memory (MAXIT board, 386max or QEMM), you'll want to use SKRES
  768.  
  769.  
  770.       Chapter I:INTRODUCTION                                     Page 14
  771.  
  772.  
  773.  
  774.  
  775.                         Documentation for STACKEY, Version 4.0 
  776.  
  777.  
  778.       rather than STACKEY as you will if you want a buffer with over
  779.       10000 keystrokes, see Section III.11.
  780.  
  781.             STACKEY will place keystrokes in its stack according to the
  782.       rules of syntax described below.  If there is a syntax error, it
  783.       will exit with no keyboard stacking and give an error message.  For
  784.       example, saying
  785.             stackey "hello "CRthere
  786.       will result in the error message
  787.             Oops!  There is an error on the STACKEY command line.
  788.              "hello "CRthere
  789.                        ^
  790.            Unrecognized command.
  791.       The arrow (shown as a caret here) will point to the first place on
  792.       the line that STACKEY was unable to interpret.  The command
  793.       line to send hello on one line and there on the next should have
  794.       said
  795.             stackey "hello "CR"there"
  796.  
  797.             The arrow will indicate other errors; for example, if you ask
  798.       STACKEY to swap printer ports but you only have one printer port,
  799.       STACKEY will exit with
  800.             Oops!  There is an error on the STACKEY command line.
  801.              {PRN}
  802.                 ^
  803.             Hardware or software environment does not appear to support
  804.                   this command.
  805.       The syntax is fine but there is an error none the less.  Similarly,
  806.       if you try to swap Carousel partitions but STACKEY finds that
  807.       Carousel isn't loaded, you will get an error message.
  808.  
  809.             The command line is parsed into parts consisting of text
  810.       between quotes, two character special codes, hex and decimal input,
  811.       delays and special commands.  Some of the two character special
  812.       commands allow an integer for the second "character" which may be
  813.       more than one numeral.  The special commands include EGA/VGA color
  814.       settings between square [] brackets and utilities commands inside
  815.       pointed braces {}.  Certain features like SCan and SHift take
  816.       parameter inside ().  If only a utility is called up and the final }
  817.       is left off, the resident part of STACKEY will not load.  Spaces
  818.       between the parts are optional so that
  819.             stackey F1"hello"^r@E
  820.       is the same as
  821.             stackey F1 "hello" ^r @E
  822.  
  823.  
  824.       Chapter I:INTRODUCTION                                     Page 15
  825.  
  826.  
  827.  
  828.  
  829.                         Documentation for STACKEY, Version 4.0 
  830.  
  831.  
  832.       or even
  833.             stackey F1               "hello" ^r@E
  834.       but
  835.             stackey F 1"hello"^r@E
  836.       which splits the two character code F1 will result in an error message.
  837.  
  838.  
  839.       I.8 HELP!!
  840.  
  841.             Eighteen screens of help are available if you type in
  842.             stackey ?
  843.       To get help, the file STACKEY.HLP distributed with STACKEY must be
  844.       available either in the default directory or in your path.  This
  845.       STACKEY.HLP file is different from the files of the same name
  846.       distributed with STACKEY 2.0 and 3.0.  If that old STACKEY.HLP is
  847.       found, STACKEY will exit with the error message:
  848.             The file STACKEY.HLP has wrong format or version number.
  849.       The first help screen is a table of contents and the last one an
  850.       index.  You can search by hitting S or goto a given page with Goto.
  851.       The help is a useful summary but not really a replacement for
  852.       reading the manual!
  853.  
  854.             On a true monochrome monitor like the original MDA or
  855.       Hercules card, STACKEY ? will show up in the proper two color
  856.       attributes.  But on a color adapter with monochrome screen (for
  857.       example, most laptops), the "colors" may make the help invisible or
  858.       ugly.  On such a screen call for help with
  859.             STACKEY ?m
  860.  
  861.             When you exit the help, a screen appears reminding you to
  862.       register.  You can suppress this screen by placing
  863.             B4$=I paid
  864.       in your environment.  Obviously, having told you the secret, you
  865.       can do it even if you haven't paid - let your conscience be your
  866.       guide.
  867.  
  868.  
  869.       I.9 ERRORLEVEL
  870.  
  871.             If STACKEY can interpret its command line and does not find
  872.       the buffer full, it exits with an error level of 0.  If there is an
  873.       error in the command line, the errorlevel is set to 1, if there is
  874.       a buffer overflow, the errorlevel is 2 and if there is any kind of
  875.       DOS file error whether due to an invalid path or an open drive door
  876.  
  877.  
  878.       Chapter I:INTRODUCTION                                     Page 16
  879.  
  880.  
  881.  
  882.  
  883.                         Documentation for STACKEY, Version 4.0 
  884.  
  885.  
  886.       in the {dumpf} utility, the errorlevel is set to 3.  You can test the
  887.       errorlevel in BATch files with the "if errorlevel.." DOS command.
  888.       All error messages are directed to standard output so you can
  889.       redirect them to NUL and suppress them if you will handle errors
  890.       with errorlevel.  An example of this can be found in the
  891.       demonstration BATch file COLOR.BAT.  If you enter an illegal
  892.       parameter value, say "color a", the BATch file responds by
  893.       suppressing an error message from STACKEY and giving you one
  894.       appropriate to the BATch file.   How STACKEY responds to an error
  895.       is controlled by the /t/ and /c/ commands discussed in Chapter III.
  896.       By default STACKEY will flush its and BIOS's buffers when there is
  897.       an error but the BATch file will continue.
  898.  
  899.             If STACKEY finds that the version number of the resident part
  900.       does not agree with the version number of the file that you have
  901.       invoked, it will exit with an errorlevel of 4.
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.       Chapter I:INTRODUCTION                                     Page 17
  933.  
  934.  
  935.  
  936.                   Chapter II:PLACING KEYSTROKES IN THE BUFFER
  937.  
  938.       II.1  Stacking text
  939.  
  940.             Most often, you will want to stack ordinary alphanumeric
  941.       data, that is the white letters in the center of the keyboard
  942.       including the numbers, punctuation, braces, etc.  You do this by
  943.       placing the text within quotes on the command line as in
  944.             stackey "hello there"
  945.       or
  946.             stackey 'hello there'
  947.       Either single or double quotes can be used.  Once a quote occurs on
  948.       the line, every letter counts until a matching quote OF THE SAME
  949.       TYPE occurs so to place
  950.             "Hi!", he said
  951.       in the stack, you can use
  952.             stackey '"Hi!", he said'
  953.       You cannot stack both types of quotes within one string but you
  954.       can stack strings with both types of quotes by using more than one
  955.       string.  For example, to stack
  956.             "I can't come", he said
  957.       use
  958.             stackey '"I can' "'" 't come", he said'
  959.       Later, we will describe the command codes SQ and DQ for placing
  960.       quotes.  You could also use:
  961.             stackey DQ"I can't come"DQ", he said"
  962.       to stack the above string.
  963.  
  964.             While you will mainly stack ASCII characters corresponding to
  965.       the white keys between quotes, you can also stack an ASCII
  966.       character such as the graphics characters.  STACKEY will simulate
  967.       the hitting of the A key if you use stackey "A"; it will simulate
  968.       entering an ASCII code above 128 as if it were entered from the
  969.       Alt-numeric keypad.
  970.  
  971.  
  972.       II.2 Two-character Codes
  973.  
  974.             Many keys on the keyboard do not correspond to any ASCII
  975.       character.  For these and also for a few ASCII characters, STACKEY
  976.       recognizes special two character codes.  The first of these can be
  977.       a special symbol such as ^, @ or #.  Because some programs like CED
  978.       give special meaning to some of these codes, we have given them
  979.       alternatives.  That is, as the FIRST character in these codes:
  980.             ~ means the same as ^
  981.             ( means the same as @
  982.             ) means the same as #
  983.             * means the same as $
  984.  
  985.  
  986.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 18
  987.  
  988.  
  989.  
  990.  
  991.                         Documentation for STACKEY, Version 4.0 
  992.  
  993.  
  994.       This replacement is only effective for the first character, so that
  995.       you cannot replace ^^ by ~~ but only by ~^.  If you need to stack a
  996.       control-^ and ^ has a special meaning, you will have to use another
  997.       method like hex codes.  These alternatives are not applicable in
  998.       the color setting commands (i.e. you cannot use [)3 1=4] in place
  999.       of [#3 1=4]).
  1000.  
  1001.             You stack function keys using one of F,S,C,A (for function,
  1002.       shifted function, control function and alt function) followed by a
  1003.       single digit; 0 stands for 10 and on an enhanced keyboard, - stands
  1004.       for 11 and = for 12 (note the - and = keys are on the numeric row
  1005.       in the eleventh and twelfth place).  Thus Ctrl-F10 is stacked with
  1006.       C0 and
  1007.             stackey C2 A3 S5 F0 A-
  1008.       would stack the sequence Ctrl-F2, Alt-F3, Shift-F5, F10, Alt-F11.  You
  1009.       may use either upper case or lower case for the key letter f,s,c,a.  Do
  1010.       not confuse ^1 (for Control-End) and C1 or @1 (for Alt-1) and A1.
  1011.  
  1012.             You can stack the numbers on the numeric keypad with N0,...,
  1013.       N9, the numeric decimal point (Shift Del) with N. and the grey +, -
  1014.       and * with N+, N- and N*.
  1015.  
  1016.             The BIOS also makes codes for certain Alt key combinations:
  1017.       legal possibilities are Alt- followed by any letter or number (top
  1018.       row numbers) or the following special symbols: - =.  These can be
  1019.       stacked by preceding the key with @, e.g.
  1020.             stackey @a @2 @-
  1021.       will stack Alt-A followed by Alt-2 followed by Alt-minus.  It does
  1022.       not matter if you use upper or lower case letters or if you use @!
  1023.       rather than @1 or @_ rather than @-.
  1024.  
  1025.             Similarly, available control combinations are the letters A-Z,
  1026.       [,\,],^,_,`,@ left arrow, right arrow, home, end, pgup, pgdn, prtsc.
  1027.       These are entered using the ^ (or ~) as the first key.  ^A through
  1028.       ^Z will enter those control codes as will ^[, ^\,....  The six
  1029.       keys, on the numeric keypad corresponding to ^Home, etc. can be
  1030.       entered with the corresponding numbers 1,3,4,6,7,9.  Thus
  1031.             stackey ^z ^Z ^[ ^6
  1032.       will stack two Ctrl-z's, an escape and then Ctrl-Right Arrow
  1033.       (but the "escape" here is entered as if you depressed the control
  1034.       key and then struck [; to enter an escape as if you hit the escape
  1035.       key, use $e or ES as described below).  For the letters, ^ may be
  1036.       followed by an upper or lower case letter.  For the remaining
  1037.       combinations, only one possibility is allowed.  For example, do not
  1038.  
  1039.  
  1040.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 19
  1041.  
  1042.  
  1043.  
  1044.  
  1045.                         Documentation for STACKEY, Version 4.0 
  1046.  
  1047.  
  1048.       confuse ^^ and ^6.
  1049.  
  1050.             In the next chapter, we will discuss the PH two character code
  1051.       which stacks a PHony keystroke and the WR two character code which
  1052.       stacks a "Wait for Request".
  1053.  
  1054.             Next, there are two character mnemonics for special key
  1055.       combinations as follows:
  1056.                 LA              Left Arrow
  1057.                 RA              Right Arrow
  1058.                 UA              Up Arrow
  1059.                 DA              Down Arrow
  1060.                 PU              Page Up
  1061.                 PD              Page Down
  1062.                 HM              Home
  1063.                 EN              End
  1064.                 IN              Insert
  1065.                 DE              Delete
  1066.                 G+         Grey plus  ("+" will send the top row +; also N+)
  1067.                 G-         Grey minus ("-" will send the top row -; also N-)
  1068.                 G*         Grey star  ("*" will send the top row *; also N*)
  1069.                 CP              Control PrtSc
  1070.                 PS              PrtSc
  1071.                 TA or TB        Tab
  1072.                 ST or BT        Shift Tab (=Back Tab)
  1073.                 ES              Escape     (also $e)
  1074.                 BS              Backspace  (also $h)
  1075.                 SP              Space bar  (also " ")
  1076.                 CR              Enter (carriage return)
  1077.                 LF              Ctrl-Enter (line feed)
  1078.                 FF              Form Feed (^L)
  1079.                 DQ              The double quote "
  1080.                 SQ              The single quote '
  1081.                 CB              Ctrl-Backspace
  1082.       These codes can be entered in upper or lower case.  It is a little
  1083.       known fact that Ctrl-Backspace is a legitimate keystroke that even
  1084.       enters a valid code: ASCII 127 which is .
  1085.  
  1086.             PS for PrtSc will simulate the pressing of the Shift-PrtSc
  1087.       key.  If some other program, e.g. PIZAZZ PLUS has taken over that
  1088.       key, it will be called up with PS.
  1089.  
  1090.             ^! will simulate the Ctrl-Break key; for techies, it places an
  1091.       ASCII 0 word in the keyboard buffer and then calls int 1BH.
  1092.  
  1093.  
  1094.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 20
  1095.  
  1096.  
  1097.  
  1098.  
  1099.                         Documentation for STACKEY, Version 4.0 
  1100.  
  1101.  
  1102.             STACKEY provides support for combinations understood by the
  1103.       enhanced keyboard or by the BIOS that comes with machines supporting
  1104.       the enhanced keyboard.  First, the following Alt-key combinations are
  1105.       allowed: Alt-[ Alt-] Alt-; Alt-' Alt-` Alt-\ Alt-, Alt-. Alt-/.
  1106.       These are entered with the combinations A[ A] A; A' A` A\ A, A. A/.
  1107.       In addition we have the following codes for the enhanced keyboard:
  1108.             Alt-Bksp           AB
  1109.             Alt-Enter          AC
  1110.             Alt-Esc            AE
  1111.             Alt-Tab            AT
  1112.             Ctrl-Tab           CT
  1113.       The alt-keypad cursor keys (i.e. everything but the 5 key but
  1114.       including Ins and Del) are allowed keys with a enhanced keyboard.
  1115.       You enter them with K followed by the number, e.g. Alt-Left is K4
  1116.       and Alt-Del is K, The center key (unshifted 5 when numlock isn't
  1117.       on) is K5.  In addition we have:
  1118.             Alt-Numpad K /       K/
  1119.             Alt-Numpad K *       K*
  1120.             Alt-Numpad K -       K-
  1121.             Alt-Numpad K +       K+
  1122.             Alt-Numpad K Enter   KC
  1123.             Ctrl- K /            ^/
  1124.             Ctrl- K *            ^*
  1125.             Ctrl- K -            ^-
  1126.             Ctrl- K +            ^+
  1127.             Ctrl- K Up [8]       ^8
  1128.             Ctrl- K 5  [5]       ^5
  1129.             Ctrl- K Dn [2]       ^2
  1130.             Ctrl- K Ins[0]       ^0
  1131.             Ctrl- K Del[.]       ^.
  1132.             Grey Enter           GE or GC
  1133.       While most programs do not distinguish them, the enhanced BIOS will
  1134.       distinguish the cursor pad keys and the numeric pad keys. The cursor
  1135.       pad keys are given by
  1136.             Cursor pad End     G1
  1137.             Cursor pad DA      G2
  1138.             Cursor pad PD      G3
  1139.             Cursor pad LA      G4
  1140.             Cursor pad RA      G6
  1141.             Cursor pad Hm      G7
  1142.             Cursor pad UA      G8
  1143.             Cursor pad PU      G9
  1144.             Cursor pad Ins     G0
  1145.             Cursor pad Del     G.
  1146.  
  1147.  
  1148.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 21
  1149.  
  1150.  
  1151.  
  1152.  
  1153.                         Documentation for STACKEY, Version 4.0 
  1154.  
  1155.  
  1156.       The logic behind the codes is a little stretched.  The G is because the
  1157.       keys are grey; the 1,2,3 correspond to the numbers the keys correspond
  1158.       to on the keypad (not the cursor pad!).
  1159.  
  1160.             An appendix to this chapter summarizes all the two character
  1161.       codes in alphabetic order.
  1162.  
  1163.       II.3 Status Toggles
  1164.  
  1165.             You can turn NumLock, etc. on or off from the STACKEY command
  1166.       line.  The syntax is
  1167.                 +N              Turn NumLock on
  1168.                 -N              Turn NumLock off
  1169.                 +C              Turn CapsLock on
  1170.                 -C              Turn CapsLock off
  1171.                 +S              Turn ScrollLock on
  1172.                 -S              Turn ScrollLock off
  1173.                 +I              Turn BIOS insert mode indicator on
  1174.                 -I              Turn BIOS insert mode indicator off
  1175.  
  1176.             Strictly speaking, the discussion of status toggles does not
  1177.       belong in this chapter since they are handled in real time.  That
  1178.       is rather than placing a command in the resident buffer, a command
  1179.       like +N is interpreted and acted on by the non-resident part of
  1180.       STACKEY as soon as it reaches the interpretation of that part of
  1181.       the command line.  In this sense, the lock toggles are like
  1182.       utilities and, indeed, they are included also in utilities mode.
  1183.       They continue to be available in two code form for compatibility
  1184.       with earlier versions of STACKEY.  BATUTIL will let you read the
  1185.       state of the lock keys from a batch file; see Section IV.9 of the
  1186.       BATUTIL documentation.
  1187.  
  1188.  
  1189.       II.4 Prompt metastrings
  1190.  
  1191.             STACKEY supports the full set of metastrings allowed in the
  1192.       DOS PROMPT command as well as the added strings supported by the
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 22
  1203.  
  1204.  
  1205.  
  1206.  
  1207.                         Documentation for STACKEY, Version 4.0 
  1208.  
  1209.  
  1210.       program SEND.COM of Howard Rumsey and Barry Simon.  Specifically:
  1211.                 $$              The character "$"
  1212.                 $t              The time in HH:MM:SS.hh format
  1213.                 $d              The date in DAY MM-DD-YYYY format
  1214.                                    e.g. Tue 9-30-1986
  1215.                 $p              The current path in full, e.g. C:\BIN\FOO
  1216.                 $v              The current DOS version
  1217.                 $n              The current default drive
  1218.                 $g              The character ">"
  1219.                 $l              The character "<"
  1220.                 $b              The character "|"
  1221.                 $q              The character "="
  1222.                 $h              The backspace
  1223.                 $e              The ESCape
  1224.                 $_              CR/LF (i.e. <Enter> followed by Ctrl-<Enter>)
  1225.                 $P              same as $p in the root dir and as $p\ elsewhere
  1226.                 $T              time in HHMM format
  1227.                 $M              month in MM format, e.g. 09
  1228.                 $D              day in DD format, e.g. 03
  1229.                 $Y              year in YY format, e.g. 86 in 1986 and 01 in
  1230.       2001
  1231.                 $W              day of the week in English, e.g. Sunday
  1232.                 $E              the date in English, e.g. February 18, 1988
  1233.                 $H              hour from 00 to 23
  1234.                 $m              minute from 00 to 59
  1235.       There is a difference between upper case and lower case after the $.
  1236.       Because of STACKEY's send mode (see Section II.10), you need no
  1237.       longer use the SEND program but can use STACKEY instead. That is,
  1238.       you can use STACKEY to send these codes to standard output.
  1239.  
  1240.             STACKEY keeps an internal flag that effects the meaning of $E.
  1241.       When the flag is American (the default but it can be set with /a/),
  1242.       $E will be, e.g., February 18, 1988  and $d is e.g. Thu 2-18-1988.
  1243.       When the flag is European (set with /e/), $E would be, e.g.,
  1244.       18 February 1988 and $d Thu 18/2/1988.  If you want the European
  1245.       effect all the time, load STACKEY with
  1246.             stackey /e/
  1247.  
  1248.  
  1249.       II.5 Decimal and Hex Codes
  1250.  
  1251.             This section deals with advanced features not needed by most
  1252.       users.  See Chapter VI for a tutorial on keyboard basics used in
  1253.       this section.
  1254.  
  1255.  
  1256.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 23
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                         Documentation for STACKEY, Version 4.0 
  1262.  
  1263.  
  1264.             You may enter various ASCII key combinations from the
  1265.       keyboard by pressing Alt (or by pressing Alt-Left Shift) and
  1266.       tapping one to three digits on the keypad and then releasing Alt.
  1267.       To stack keystrokes as if entered in this way use \ followed by a
  1268.       decimal number, so
  1269.             stackey \104\101\108\108\111
  1270.       at the DOS command line will cause "hello" to appear on your
  1271.       screen.
  1272.  
  1273.             Keystrokes are stored in the buffer as a set of two hex
  1274.       bytes: a scan code and an ASCII code.  You can enter such a
  1275.       combination by typing an X followed by four hex digits.  The first
  1276.       two are the scan code and the second pair the ASCII code.  For
  1277.       example
  1278.             stackey X2368 X1265 X266C X266C X186F
  1279.       at the DOS command line will cause "hello" to appear on your
  1280.       screen.  The hex digits a-f and the letter x can be either upper or
  1281.       lower case.
  1282.  
  1283.             Because they are used internally by STACKEY, the scan codes
  1284.       E0 through FF (which are not legal anyway) are allowed but take
  1285.       the place of two keystrokes in STACKEY's buffer.  STACKEY will
  1286.       place in the keyboard buffer whatever combination you tell it to
  1287.       even if it is an illegal combination.  DOS will only pay attention
  1288.       to the ASCII half of such combination as will many programs.  Some
  1289.       keyboard macro programs will allow such possibilities.  For
  1290.       example, KEYWORKS associates Ctrl-Up Arrow (a keystroke not
  1291.       supported by an old style BIOS) with 8448.  Stackey X8448 will call
  1292.       up the KEYWORKS macro assigned to Ctrl-Up if one is defined.   Some
  1293.       combinations are filtered out by the so-called enhanced keyboard.
  1294.  
  1295.  
  1296.       II.6 Invoking special programs and keystrokes
  1297.  
  1298.             Most TSRs will not pop up by responding to strokes in the
  1299.       keyboard buffer and, as a result, STACKEY cannot invoke them by its
  1300.       usual method.  However, when we have special information about a
  1301.       program, we can provide a special routine for that program in
  1302.       particular.  We'll discuss those commands, all new in Version 3.0
  1303.       here.  For programs that popup on depression of several shift keys,
  1304.       like SIDEKICK, we can simulate depressing shift keys as discussed
  1305.       in the next section.  Here are the special invocation routines:
  1306.  
  1307.  
  1308.  
  1309.  
  1310.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 24
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                         Documentation for STACKEY, Version 4.0 
  1316.  
  1317.  
  1318.             CTRLALT PLUS: CA will invoke the main menu of CTRLALT PLUS so,
  1319.       for example
  1320.               stackey CA"MAP"
  1321.       will print the entire screen even if you are in 43 or 50 line mode.
  1322.       If CTRLALT PLUS is not loaded, you'll get an error message from
  1323.       STACKEY.
  1324.  
  1325.             DESQVIEW: Quarterdeck provides two methods for macros to
  1326.       simulate the Desq key which work on different keyboards or BIOS.  We
  1327.       have assigned them to D1 and D2.  So for example
  1328.               stackey D1"Z"
  1329.       would zoom the current window to full screen.  The combination DL is
  1330.       the same as the Desqview learn key.  Finally {boot=d} as a utility will
  1331.       invoke a Desqview specific reboot command.
  1332.  
  1333.             CAROUSEL: You can tell Carousel to switch to partition n with
  1334.       Qn where n=1,2,...,9,0 (0 is for partition 10); with Carousel 3.0
  1335.       or later, you can also use Q- and Q= to switch to partitions 11 and
  1336.       12.  Thus you might have a sequence of BATch files that successively
  1337.       loads partitions 1,2,....  If you want to load program "foobar" in
  1338.       partition 6, issue the string "hello" followed by F1 to the program
  1339.       and then switch to partition 7, you'd end the batch file for
  1340.       partition 6 with
  1341.                stackey "hello" F1 W36 Q7
  1342.                foobar
  1343.       The wait command W36 which is discussed in the next chapter (and
  1344.       pauses for 2 seconds) gives the program time to react to the
  1345.       keystrokes before the swap.  You may need to adjust the W command
  1346.       for particular applications.
  1347.  
  1348.             TESSERACT PROGRAMS: Tesseract is a library of TSR routines
  1349.       provided by Innovative Data Concepts as a shareware product.  If a
  1350.       TSR is written with these routines, you can invoke it with the TE
  1351.       command:
  1352.             stackey TE(idstring)
  1353.       will call up the tesseract TSR with the given idstring name.  You'll
  1354.       need to consult the documentation that came with your program to
  1355.       find the required id string but here is an example.  Suppose you
  1356.       have SWAPSP and want to dial the third entry in your phone book
  1357.       under M.  Use
  1358.          stackey TE(SWAPSP15)"PM"DNDNCR
  1359.       The idstring must be exactly eight characters in length.  For
  1360.       Tesseract programs that allow multiple hotkeys, each hotkey has an
  1361.       a number.  TE(idstring) will call the program with hotkey 0.  For
  1362.  
  1363.  
  1364.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 25
  1365.  
  1366.  
  1367.  
  1368.  
  1369.                         Documentation for STACKEY, Version 4.0 
  1370.  
  1371.  
  1372.       other hotkeys, place a /NN after the idstring.  Thus, for example
  1373.             stackey TE(idstring/23)
  1374.       would invoke the program in question via hotkey 23.
  1375.  
  1376.             CLONE SPEEDUP/SLOWDOWN:  Many clones have two speeds adjusted
  1377.       with ^@G+/-.  You can simulate this with
  1378.                stackey Z+
  1379.       to speedup and
  1380.                stackey Z-
  1381.       for slowdown.  This will not work with all clones.
  1382.  
  1383.             You might object to some of these additions to STACKEY by
  1384.       saying that you don't use CAROUSEL and object to resident memory
  1385.       being taken by the CAROUSEL command.  In fact, most of these
  1386.       commands take NO additional memory - they use the inline feature
  1387.       discussed in Section VI.7.
  1388.  
  1389.  
  1390.       II.7 Simulating depression of shift keys
  1391.  
  1392.             Some popups come up when you depress a pair of shift keys.
  1393.       You can simulate the depression of any subset of the four shifts
  1394.       with the command SH which takes two parameters in the form
  1395.             SH(XXX,YY)
  1396.       where XXX is some subset of the letter C,A,L,R for the Control, Alt,
  1397.       Left shift and Right shift respectively and YY is a number from 1 to
  1398.       65,535.  This command simulates depressing the shift keys in
  1399.       question for YY clock ticks.  You'll need to experiment with the
  1400.       value of YY depending on the program.  We added that parameter
  1401.       because different programs seem to require different values.  For
  1402.       example, with a default SIDEKICK Ctrl+Alt, you can invoke the
  1403.       SIDEKICK main menu from within a STACKEY script with
  1404.             stackey SH(CA,1)
  1405.       but invocation of SIDEKICK PLUS requires
  1406.             stackey SH(CA,n)
  1407.       where n is at least 7 or 8 while PRIMETIME (with say C+L as hot
  1408.       key) seems to require
  1409.             stackey SH(CL,10)
  1410.       You'll need to adjust the shift mask to whatever combination you've
  1411.       chosen for your application.  For example, if you've changed the
  1412.       SIDEKICK popup to C+L use SH(CL,1) rather than SH(CA,1).
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 26
  1419.  
  1420.  
  1421.  
  1422.  
  1423.                         Documentation for STACKEY, Version 4.0 
  1424.  
  1425.  
  1426.       II.8 Stacking real time beeps
  1427.  
  1428.             STACKEY scripts can include real time BIOS beeps with the special
  1429.       two key code BE.  Beeps are especially useful combined with loops and
  1430.       waits and with jumps (see Section III.2).
  1431.  
  1432.  
  1433.       II.9 Popup messages
  1434.  
  1435.             STACKEY scripts can include popup messages that are displayed and
  1436.       take over the machine until the user hits a key.  There are two versions
  1437.       depending on whether you want the key hit passed to the underlying
  1438.       application.
  1439.             STACKEY MP(hi there)
  1440.       will display the message "hi there" in a box and pass the keystroke on
  1441.       while
  1442.             STACKEY ME(hi there)
  1443.       would eat the keystroke.  These messages are implemented as inline code
  1444.       to avoid having to permanently use resident memory but as a result they
  1445.       take a lot of buffer space.  A message takes 156 bytes plus 7 times the
  1446.       length of the message. The default buffer has only 256 bytes so that
  1447.       long messages will require you to load STACKEY with the command (see
  1448.       Sections III.11 and III.12) to take a larger buffer.
  1449.  
  1450.  
  1451.       II.10 Sending to standard output
  1452.  
  1453.             STACKEY places keystrokes in the keyboard buffer.  However,
  1454.       you can tell STACKEY to instead send the interpreted material to
  1455.       standard output.  You could then redirect this output to a file or
  1456.       the printer.  Thus STACKEY provides a replacement for the SEND
  1457.       program of Rumsey and Simon.  With their permission, a modified
  1458.       version of the documentation for SEND is provided as an appendix to
  1459.       this chapter.
  1460.  
  1461.             To send output to the standard output, include the special
  1462.       symbol underscore in the STACKEY command line so that
  1463.             STACKEY _"hello"$_
  1464.       will have the same effect as
  1465.             echo hello
  1466.       Following _ the ONLY allowed codes are:
  1467.             character strings in quotes
  1468.             control codes of the form ^x with x=a,...,z,[,\,],^ or _ (but
  1469.                not ^1, or ^@ etc)
  1470.  
  1471.  
  1472.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 27
  1473.  
  1474.  
  1475.  
  1476.  
  1477.                         Documentation for STACKEY, Version 4.0 
  1478.  
  1479.  
  1480.             prompt metastrings in extended form as discussed above
  1481.             upper ASCII codes in the form \xxx
  1482.             the following two character codes: TA, TB, ES, BS, SP, CR, LF,
  1483.                FF, SQ, BQ, CB
  1484.       Any other codes, even ones normally legitimate in STACKEY (e.g. LA
  1485.       which doesn't have an ASCII equivalent) will produce an error
  1486.       message but only AFTER the codes prior to it on the command line
  1487.       are already sent to standard output.
  1488.  
  1489.             The special command _ is only in effect for the line it is
  1490.       issued on; you must include it on each line which you wish to send
  1491.       to standard output.  It need not be the first command on the line and a
  1492.       second _ will toggle back to real mode.
  1493.  
  1494.             If you have CED or a similar command line processor that
  1495.       allows synonyms or aliases, we suggest that you use
  1496.             CED SYN send 'stackey _&a'
  1497.  
  1498.  
  1499.       Appendix 1 to Chapter II. Two character codes
  1500.  
  1501.             Here is a list of the two character codes understood by STACKEY
  1502.       (cases where the "second" key is nnnn are shorthand for nnnn being a
  1503.       number):
  1504.  
  1505.       @ followed by
  1506.             letter, number, - or = : Alt-keystrokes
  1507.       ( followed by
  1508.             letter, number, - or = : Alt-keystrokes
  1509.       ^ followed by
  1510.             letter, 1,3,4,6,7,9, [ \ ] ^ _ ` @ : control key combinations
  1511.             0,2,5,8,.,+,-,*,/ : control key combinations (enhanced only)
  1512.             ! : ^! = Ctrl-Break)
  1513.       ~ followed by
  1514.             letter, 1,3,4,6,7,9, [ \ ] ^ _  @ : control key combinations
  1515.             0,2,5,8,.,+,-,*,/ : control key combinations (enhanced only)
  1516.             ! : ~! = Ctrl-Break)
  1517.       \ followed by
  1518.             nnn : Decimal ASCII code
  1519.       # followed by
  1520.             nnnn: repeat command (including loops)
  1521.       ) followed by
  1522.             nnnn: same as #nnnn (including loops)
  1523.       $ followed by
  1524.  
  1525.  
  1526.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 28
  1527.  
  1528.  
  1529.  
  1530.  
  1531.                         Documentation for STACKEY, Version 4.0 
  1532.  
  1533.  
  1534.             $ t d p v n g l b q h e _ P T M D Y W E H m : metastrings
  1535.       * followed by
  1536.             $ t d p v n g l b q h e _ P T M D Y W E H m : metastrings
  1537.       + followed by
  1538.             N,S,C,I: turn on locks
  1539.       - followed by
  1540.             N,S,C,I: turn off locks
  1541.       : followed by
  1542.             0 1 2 3 4 5 6 7 8 9: labels (see Section III.2)
  1543.       A followed by
  1544.             number: Alt-function keys
  1545.             - = : Alt-function keys (enhanced keyboard only)
  1546.             [ ] ; ' ` \ , . / :  Alt-key combos (enhanced only)
  1547.             B : AB = Alt-Backspace (enhanced only)
  1548.             C : AC = Alt-Enter (enhanced only)
  1549.             E : AE = Alt-Esc (enhanced only)
  1550.             T : AT = Alt-Tab (enhanced only)
  1551.       B followed by
  1552.             E : BE = BIOS BEep
  1553.             S : BS = BackSpace
  1554.             T : BT = BackTab (=Shift-Tab)
  1555.       C followed by
  1556.             number: Ctrl-Function key
  1557.             - = : Ctrl-Function key (enhanced keyboard only)
  1558.             A : CA = invoke CTRLALT PLUS
  1559.             B : CB = Ctrl-Backspace
  1560.             P : CP = Ctrl-Printscr
  1561.             R : CR = Carriage Return
  1562.             T : CT = Ctrl-Tab (enhanced keyboard only)
  1563.             L : Caps-Lock (as hotkey ONLY)
  1564.       D followed by
  1565.             A : DA = Down Arrow
  1566.             E : DE = DElete
  1567.             Q : DQ = Double Quote (i.e. ")
  1568.             1, 2: D1 or D2 = Invoke Desqview main menu (Desq key)
  1569.             L : DL = Invoke Desqview Learn mode
  1570.       E followed by
  1571.             N : EN = ENd
  1572.             S : ES = EScape
  1573.       F followed by
  1574.             number: unshifted function keys
  1575.             - = : unshifted function keys (enhanced keyboard only)
  1576.             F : FF = Form Feed (Ctrl-L, ASCII 12)
  1577.       G followed by
  1578.  
  1579.  
  1580.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 29
  1581.  
  1582.  
  1583.  
  1584.  
  1585.                         Documentation for STACKEY, Version 4.0 
  1586.  
  1587.  
  1588.             + - *,: Grey Plus, Minus, Star
  1589.             E C : Grey Enter (enhanced keyboard only)
  1590.             0,1,2,3,4,6,7,8,9,.: Cursor pad keys (enhanced only,
  1591.                 see Section II.2)
  1592.       H followed by
  1593.             ! + - * : Hotkeys, see Section III.6; e.g. H!(.,.)
  1594.             M: HM = HoMe
  1595.       I followed by
  1596.             N : IN = INsert
  1597.       J followed by
  1598.             0 1 2 3 4 5 6 7 8 9 : jumps (see Section III.2)
  1599.       K followed by
  1600.             1,2,3,4,6,7,8,9,0,. : Alt-Keypad (enhanced keyboard only)
  1601.             5 : Keypad unshifted 5 key (enhanced keyboard only)
  1602.             /,+,-,* : Alt-Grey keys: enhanced keyboard only
  1603.             C : Alt-Grey-Enter (Carriage return, enhanced keyboard only)
  1604.       L followed by
  1605.             A : LA = Left Arrow
  1606.             F : LF = Line Feed (Ctrl-Enter, Ctrl-J, ASCII 10)
  1607.       M followed by
  1608.             P, E : Messages with passing or eating keystroke
  1609.             nnnn : Wait minutes (see Section III.3)
  1610.       N followed by number
  1611.             0 1 2 3 4 5 6 7 8 9 : Numeric keypad
  1612.             . : Shift-Del (Numeric decimal point)
  1613.             + - * : Grey keys (near keypad)
  1614.             L : NumLock (Hotkeys only)
  1615.       P followed by
  1616.             D : PD = PageDown
  1617.             H : PH = Phony keystroke (see Section III.5)
  1618.             S : PS = Shift-PrintScreen
  1619.             U : PU = PageUp
  1620.             + - : suppress, reenable printscreen key
  1621.       Q followed by
  1622.             number : Carousel partition switch
  1623.             - = : Carousel 3.0 partition switch to partitions 11, 12
  1624.       R followed by
  1625.             A : RA = Right Arrow
  1626.       S followed by
  1627.             number : Shift Function key
  1628.             - = : Shift Function key (enhanced keyboards only)
  1629.             C : SC(..) = SCan ; also SCn,m(..) (see Section III.4)
  1630.             S : SS(..) = Scan Silently (see Section III.4)
  1631.             J:  SJ(..) = Scan Jump (see section III.4)
  1632.  
  1633.  
  1634.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 30
  1635.  
  1636.  
  1637.  
  1638.  
  1639.                         Documentation for STACKEY, Version 4.0 
  1640.  
  1641.  
  1642.             U:  SU(..) = Scan jUmp silently (see section III.4)
  1643.             H : SH(.,.) = SHift mask (see Section II.7)
  1644.             P : SP = SPace
  1645.             Q : SQ = Single Quote (')
  1646.             T : ST = Shift Tab
  1647.             L : Scroll Lock (Hotkey only)
  1648.             R : SysReq (Hotkey only)
  1649.       T followed by
  1650.             A B : TAB
  1651.             E : TE = TEsseract callup (see Section II.6)
  1652.       U followed by
  1653.             A : UA = Up Arrow
  1654.             N:  UNhh:mm = resident UNtil command (see Section III.3)
  1655.       W followed by
  1656.             B : WB = Wait for Buffer to be empty (see Section III.3)
  1657.             H K S : Wait for Hotkey, any Key, Specific key (see Section
  1658.                           III.7)
  1659.             J:  WJ Wait and Jump on multiple hotkeys
  1660.             R : WR = "Wait for Request"; pauses script until a key is
  1661.                           requested (see Section III.5)
  1662.             nnn : Wait command (see Section III.3)
  1663.       X followed by
  1664.             nnnn : Hex key (see Section II.5)
  1665.       Z followed by
  1666.             + - : speedup up/down (see Section II.6)
  1667.  
  1668.  
  1669.       Appendix 2 to Chapter II.  SENDing to STDOUT
  1670.  
  1671.             The following is a revised version of part of the
  1672.       documentation from SEND by Rumsey and Simon included with
  1673.       permission.  It discusses how to use STACKEY's send to standard
  1674.       output mode invoke with an underscore in the STACKEY command line.
  1675.  
  1676.             stackey _<string>
  1677.       is an enhanced version of the ECHO command, ideal for sending escape
  1678.       sequences to the printer or screen.  We'll refer to it as SEND.
  1679.       This appendix is primarily a tutorial on ECHO, SEND and redirection
  1680.       of output.
  1681.  
  1682.             You may be used to exploiting ECHO in your batch files but
  1683.       may not be aware that it can be invoked from the DOS command line.
  1684.       If that is the case, type in at the DOS prompt:
  1685.             echo hello
  1686.  
  1687.  
  1688.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 31
  1689.  
  1690.  
  1691.  
  1692.  
  1693.                         Documentation for STACKEY, Version 4.0 
  1694.  
  1695.  
  1696.       You need to also hit <Enter> but we won't keep saying that.  The
  1697.       response is amusing but not useful.  Next try:
  1698.             echo hello > prn
  1699.       More interesting!  Still not so useful but at least if you ever
  1700.       want to use your printer as a typewriter you can do it yourself
  1701.       without needing a BASIC program which does precisely that.
  1702.  
  1703.             Now try
  1704.             echo <Ctrl G>
  1705.       where "<Ctrl G>" means to hit a "control-G", that is to depress the
  1706.       <Ctrl> key and strike the G.  With a dot matrix printer try
  1707.             echo <Ctrl G> > prn
  1708.       These are decidedly more interesting and you may even think of some
  1709.       uses for them in batch files!
  1710.  
  1711.             Next try turning off your printer, carefully aligning your
  1712.      printer paper, turning your printer back on and typing
  1713.             echo <Ctrl L> > prn
  1714.       <Ctrl L> is the command to send a "top of form" to your printer but
  1715.       if you look carefully you will discover that more than a top of
  1716.       form was sent to the printer.  ECHO automatically inserts a
  1717.       carriage return-line feed pair (CR-LF) to the end of any line so
  1718.       your last command first sent a top of form but then advanced the
  1719.       paper one additional line.  Annoying, isn't it?
  1720.  
  1721.             Next try:
  1722.             echo <Esc>
  1723.       and
  1724.             echo <Ctrl [>
  1725.       (Escape and Control-[ are the same).  This doesn't do what you
  1726.       might hope.  <Esc> is interpreted by DOS as a desire on your part
  1727.       to abort the present command and thus you cannot use ECHO at the
  1728.       command line to send an <Esc> to either the screen or your printer.
  1729.       This is unfortunate since ANSI.SYS allows you to do all sorts of
  1730.       nice things if you send the proper "escape sequences" to the screen
  1731.       and many printers can be told to turn on boldface or other neat
  1732.       things by sending escape sequences to them.  You can send such
  1733.       sequences to the printer by using some word processors (even EDLIN
  1734.       (ugh!) if you use its <Ctrl V> feature) to make a file with
  1735.       embedded escape characters which you can copy to your printer. But
  1736.       you then need to have these files around and you have files with
  1737.       embedded control characters which you may have trouble printing out
  1738.       or sending over a modem.
  1739.             SEND is intended to remedy these defects of ECHO:
  1740.  
  1741.  
  1742.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 32
  1743.  
  1744.  
  1745.  
  1746.  
  1747.                         Documentation for STACKEY, Version 4.0 
  1748.  
  1749.  
  1750.             1. It does not terminate line in a CR-LF combination; one can
  1751.               add such a pair "by hand".
  1752.             2. Typing "stackey _^G" is equivalent (except for the lack of
  1753.               a CR-LF) to typing "echo <Ctrl G>" so one need not fill
  1754.               files with control characters.
  1755.             3. Typing "stackey _^['E' > prn" will send a <Esc>E to the
  1756.               printer thereby turning on "emphasized" print.
  1757.       In addition, as will be explained, SEND supports the PROMPT $-
  1758.       characters.
  1759.  
  1760.             SEND works much like ECHO but if the string to be echoed
  1761.       includes the caret (<Shift 6> which appears as ^), different rules
  1762.       apply.  SEND will replace ^a by the character <Ctrl A> (ASCII 1),
  1763.       etc.  ^ followed by any letter is replaced by the corresponding
  1764.       control character whether the letter is upper case or lower case.
  1765.       The remaining control characters:
  1766.             ^[=ASCII 27 (1B Hex)=<Esc>
  1767.             ^\=ASCII 28 (1C Hex)
  1768.             ^]=ASCII 29 (1D Hex)
  1769.             ^^=ASCII 30 (1E Hex)
  1770.             ^_=ASCII 31 (1F Hex)
  1771.       may be included by following a caret by the appropriate symbol.
  1772.       Obviously, ^[, the escape character will be used most often.
  1773.  
  1774.             SEND does not automatically terminate any line in a CR-LF
  1775.       (ASCII 13,ASCII 10) pair.  Thus typing "echo hello" at the DOS
  1776.       command line will result in two lines on the screen before the
  1777.       next DOS prompt: one line saying hello and the other a blank line.
  1778.       Typing
  1779.             stackey _"hello"
  1780.       will only produce the one line saying hello. If one wants the CR-LF
  1781.       pair, one can insert it "by hand"; thus
  1782.             stackey _"hello"^M^J
  1783.       will have the exact same effect  as "echo hello". As we will see in
  1784.       the next section
  1785.             stackey _"hello"$_
  1786.       is also equivalent.  It is important to remember to put in these
  1787.       CR-LF by hand if you are using SEND in a batch file to echo a
  1788.       message to the screen.  For example the four line batch file
  1789.             echo off
  1790.             cls
  1791.             stackey _"hello"
  1792.             stackey _"there"
  1793.       will produce the string "hellothere" on one line on the screen
  1794.  
  1795.  
  1796.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 33
  1797.  
  1798.  
  1799.  
  1800.  
  1801.                         Documentation for STACKEY, Version 4.0 
  1802.  
  1803.  
  1804.       while adding $_ after "hello" or even replacing the last two lines
  1805.       by
  1806.             stackey _"hello"$_"there"
  1807.       will produce a two line message with one word on each line.  You
  1808.       may find BATUTIL better to use for echoing messages to the screen.
  1809.  
  1810.             SEND supports the $-metastring conventions of the DOS PROMPT
  1811.       In accordance with the general STACKEY metastring translation, a
  1812.       special interpretation is made if the $ is immediately followed by
  1813.       one of the following:
  1814.             $
  1815.             g,l,b,q
  1816.             h,_,e
  1817.             t,d,p,v,n
  1818.             P,M,D,Y,T,W,E,H,m
  1819.  
  1820.             The case of the letter following $ is significant.  The
  1821.       metastrings are described in Section II.4. $g,$l,$b,$q correspond
  1822.       to the characters >,<,|,= respectively.   You can use the ordinary
  1823.       "=" in a line starting with "stackey _", but you CANNOT type >,< or
  1824.       | in such a line since DOS will interpret these symbols as
  1825.       redirection or piping.  You must use the $-metastring instead.
  1826.       For example, if you use FANSI-CONSOLE and want to send the ANSI
  1827.       code "<Esc>[>4h" typing the command
  1828.             stackey _^["[">4h
  1829.       will make a file "4h" with two bytes in it while
  1830.             stackey _^["["$g"4h"
  1831.       will do exactly what you want.
  1832.  
  1833.             $h is equivalent to ^H, ASCII 8, the "backspace" which, if
  1834.       sent to the screen, moves the cursor back one space.  Like the
  1835.       $h of the Rumsey-Simon SEND program, the STACKEY SEND $h does not
  1836.       erases the previous character.  Thus
  1837.             stackey _"a"$h
  1838.       will show an "a" on the screen and
  1839.             stackey _"a"$h"b"
  1840.       will show a "b" on the screen since the cursor will backspace one
  1841.       unit and the b will overwrite the a.  But the command
  1842.             stackey _"a"$h"b">file
  1843.       will produce a file with three bytes: a,<Ctrl H>,b.
  1844.  
  1845.             $t and $d send the time and date in the form returned by the
  1846.       TIME and DATE commands.  Thus the time will appear as HH:MM:SS:hh.
  1847.       If you only want the hours and minutes to appear on the screen, you
  1848.  
  1849.  
  1850.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 34
  1851.  
  1852.  
  1853.  
  1854.  
  1855.                         Documentation for STACKEY, Version 4.0 
  1856.  
  1857.  
  1858.       can use
  1859.             stackey _$t$h$h$h$h$h$h"      "
  1860.       (There are six spaces after the final $h and they are important!).
  1861.  
  1862.             One of the most useful things you can do with SEND is exploit
  1863.       the ANSI.SYS device driver.  ANSI.SYS is a file that comes with DOS
  1864.       (version 2.0 and higher).  You need to load it in your CONFIG.SYS
  1865.       file.  If you already have such a file, add a line
  1866.             device=ansi.sys
  1867.       to it and place ANSI.SYS in your root directory or, even better,
  1868.       place ANSI.SYS in a directory, say GEORGE and add a line
  1869.             device=\george\ansi.sys
  1870.       to your CONFIG.SYS file. If you don't have such a file, add one to
  1871.       your root directory with one of the above lines and while you're at
  1872.       it, you should probably add files=20 and buffers=15 (unless the
  1873.       memory of your computer is very limited).
  1874.            You can read about the syntax of the ANSI.SYS commands in the
  1875.       DOS 2.0 manual or the DOS 3.0 technical reference.  ANSI.SYS can be
  1876.       used to control screen colors on a color monitor, and attributes on
  1877.       a monochrome monitor.  For example,
  1878.             stackey _$e"[1;31;42m"
  1879.       will produce an unpleasant screen while
  1880.             stackey _$e"[1;33;44m"
  1881.       will be more to your liking.  Actually, it is best to set your
  1882.       screen colors using the DOS PROMPT command.  You can use SEND to
  1883.       call up colors and attributes for effect in batch files.  BATUTIL
  1884.       will generally give you better color control.
  1885.  
  1886.             You can also use SEND and ANSI.SYS to redefine keys in DOS.
  1887.  
  1888.             DOS, following UNIX, supports two virtual devices called
  1889.       "standard input" (stdin) and "standard output" (stdout).  Programs
  1890.       rather than sending their output to a specific device like the
  1891.       screen or printer can send them to stdout and similarly rather than
  1892.       take input from a specific device, they can take it from stdin.  If
  1893.       not specified otherwise, stdout is sent to the currently active
  1894.       screen and stdout is taken from the keyboard (i.e. the DOS command
  1895.       line).  However, one can redirect stdout to another device.  For
  1896.       this to work the program MUST send its output to stdout.  For
  1897.       example, the "main output" of the COPY command goes not to stdout
  1898.       but to the second file specified on the command line; only the
  1899.       message that COPY sends goes to stdout.  Thus "copy somefile prn"
  1900.       will print a file on your printer, but "copy somefile > prn" will
  1901.       print the error message
  1902.  
  1903.  
  1904.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 35
  1905.  
  1906.  
  1907.  
  1908.  
  1909.                         Documentation for STACKEY, Version 4.0 
  1910.  
  1911.  
  1912.             File cannot be copied onto itself
  1913.                     0 File(s) copied
  1914.  
  1915.             If a program takes its input from stdin, that too can be
  1916.       redirected.  One redirects output using the symbol ">" and input
  1917.       using "<".
  1918.             STACKEY's SEND sends its output to stdout and that can be
  1919.       redirected, for example to a printer or file.  It takes its input
  1920.       from the keyboard rather than from stdin so one cannot redirect
  1921.       input.
  1922.  
  1923.             SEND can also be used for sending control sequences to your
  1924.       printer.  Unfortunately, the sequences to be used tend to be highly
  1925.       dependent on the brand and/or model of your printer.
  1926.       The simplest example is a one line batch file entitled tf.bat
  1927.             stackey _^L> prn
  1928.       Typing tf at the DOS command line will cause your printer to eject
  1929.       a page.  You might even want to define a function key to mean tf.
  1930.       A more sophisticated example is the five line batch file
  1931.       BOLDPRN.BAT, for IBM graphics printers:
  1932.             echo off
  1933.             cls
  1934.             stackey _$e"E"$e"G">prn
  1935.             copy %1 prn
  1936.             stackey _$e"F"$e"H">prn
  1937.       Thus typing "boldprn MYFILE" will print a boldface (=emphasized and
  1938.       doublestrike) copy of myfile on your printer.  You might consider
  1939.       adding the line:
  1940.             stackey _$P"%1 printed on "$d>prn
  1941.       before the "copy..." line.
  1942.             A particularly useful way of sending printer codes is to use
  1943.       send in CED synonyms if you have the program CED or in 4DOS
  1944.       aliases.
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.       Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 36
  1959.  
  1960.  
  1961.  
  1962.  
  1963.                   Chapter III:COMMANDS TO THE RESIDENT PORTION
  1964.  
  1965.       III.1 Overview
  1966.  
  1967.             There are various ways that you can pass commands to the
  1968.       resident part of STACKEY.  Seven discussed here: delays, repeats, the
  1969.       two types of scan, WB, WR and PH, and the color commands [],L,P
  1970.       discussed in the next chapter are just stored as special "keystrokes"
  1971.       in STACKEY's buffer so it processes them as they are reached.  The
  1972.       command to flush the buffer is acted on immediately and the command to
  1973.       quit which we discuss below is properly speaking not a command to the
  1974.       resident part but to the command line interpreter.
  1975.  
  1976.             The commands /Bxxxx/ and /Rxxxx/ are commands to the part of
  1977.       the program that loads the resident part and strictly speaking not
  1978.       commands to the resident part.
  1979.  
  1980.             Another set of commands set certain flags (toggles) which the
  1981.       resident part keeps and effect how the command line is
  1982.       interpreted.  Thus, in a certain sense these are commands to the
  1983.       interpreter but ones which are kept track of in the resident part.
  1984.       The toggles come in pairs:
  1985.             /T/ and /N/ turn test mode on and off (default is off)
  1986.             /S/, /P/ and /I/ choose among smart, patient and impatient
  1987.                processing (the default is smart)
  1988.             /C/ and /D/ turn continue mode on and off (default is off)
  1989.             /A/ and /E/ set American vs. European date flag (default is A)
  1990.       When /A/ is in effect $E translates to January 15, 1992 (on that
  1991.       day) while if /E/ is in effect, it translates to 15 January 1992.
  1992.       Similarly, $d translates to Wed 1-15-1992 with /A/ and to Wed
  1993.       15/1/1992 with /E/.
  1994.  
  1995.  
  1996.       III.2 Repeats and loops
  1997.  
  1998.             If you need to stack ten left arrows, you will not appreciate
  1999.       having to type LA ten times (nor do you want to take that much
  2000.       space in STACKEY's buffer).  Thus STACKEY allows a key repeat
  2001.       command.  # followed by a decimal number from 1 to 255 will result
  2002.       in the next key stroke being repeated that number of times, so
  2003.             stackey #7 F1
  2004.       will stack 7 F1's while
  2005.             stackey #7 "hello"
  2006.       will stack hhhhhhhello.  Trying to repeat a repeat command (as in
  2007.       #2#4) or a delay (as in #2W6) is not recommended.  Indeed,
  2008.       following a repeat command with anything that isn't a keystroke
  2009.       will produce unexpected effects.
  2010.  
  2011.  
  2012.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 37
  2013.  
  2014.  
  2015.  
  2016.  
  2017.                         Documentation for STACKEY, Version 4.0 
  2018.  
  2019.  
  2020.             Sometime, you will want to repeat a set of 'keystrokes' multiple
  2021.       times (loop) and for this you need only use # followed by a number
  2022.       followed by [, the commands and ] so for example
  2023.             stackey #3["hello"]
  2024.       would enter "hellohellohello". You might try
  2025.             stackey #10[BE W5]
  2026.       in a batch file which will produce 10 beeps and which would notify you
  2027.       from another room.
  2028.  
  2029.             We recommend that repeats also by handled as loops; the
  2030.       repeat command is only included for compatibility with earlier
  2031.       versions.  Future versions of STACKEY may remove support for the #
  2032.       command with the [..] required by loops.
  2033.  
  2034.             In addition STACKEY supports labels for use with the branching
  2035.       scans (SJ, SU) and hotkeys (WJ) or for use in external com files we
  2036.       might supply (or you if you have programming background) and a
  2037.       single jump command.  Taking a leaf from batch file labels, STACKEY
  2038.       labels are :0 through :255 and j7 would unconditionally jump to :7 if
  2039.       it exists.  Thus
  2040.           stackey :0 BE W5 J0
  2041.       would beep forever; more properly, it will beep until you flush the
  2042.       buffer with the STACKEY hotkey AL!  As an example of how to use jumps
  2043.       look at the sample external file sample.msg and try
  2044.             stackey  W20 EX(sample.msg) :1 BE 'yes' J0  :2'no'
  2045.       This is described in detail in Section VI.9.
  2046.  
  2047.  
  2048.       III.3 Delays and the Resident Until
  2049.  
  2050.             There will be times that an application program will flush
  2051.       the keyboard buffer before asking for a keystroke.  This is to
  2052.       force you to respond or to make sure the response is not
  2053.       accidental.  If you just stack the strokes you want, they will get
  2054.       flushed out.  A famous example of this is 1-2-3.  STACKEY provides
  2055.       several ways to try to get around this problem: delays, two kinds of
  2056.       phony keystrokes and patient processing.  STACKEY allows you to place a
  2057.       delay into the stack so that when those strokes are gotten to, STACKEY
  2058.       will pause before inserting them in the buffer.  You specify the time
  2059.       to pause in 55 millisecond units (clock ticks; there are about 18.2 per
  2060.       second).  This is done with the command Wn where n is from 1 to
  2061.       65535 so
  2062.             stackey W36 ES
  2063.       will Wait about 2 seconds before it puts an <Esc> into the buffer.
  2064.  
  2065.  
  2066.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 38
  2067.  
  2068.  
  2069.  
  2070.  
  2071.                         Documentation for STACKEY, Version 4.0 
  2072.  
  2073.  
  2074.       You can use either w or W.  65535 ticks is about one hour.  If you
  2075.       need a longer wait, you can stack multiple waits or use a loop.
  2076.       New in STACKEY 3.0 is the M command.  M is followed by an integer n
  2077.       from 1 to 65535 and delays for n minutes where a "minute" is really
  2078.       1092 clock ticks.   Each hour of delay via the M command takes 4
  2079.       bytes of buffer.  A delay of a week would require about 320
  2080.       keystrokes more than the default 128.
  2081.  
  2082.             You should distinguish between what we call delays and what
  2083.       we call waits.  For consistency with version 1.0 we still use the
  2084.       letter W for delays.  Delays are set with the command Wnnn while
  2085.       waits are set with the {WAIT=nnn} utilities mode command.  Delays
  2086.       are commands to the resident part of STACKEY telling it to delay
  2087.       placing strokes in BIOS' buffer (or setting colors) while operating
  2088.       in the background as some underlying program is running.  Waits are
  2089.       commands to the foreground part of STACKEY telling it to loop and
  2090.       control all machine resources (although you can call up a program
  2091.       like SIDEKICK) until the wait period is over.  Thus waits will be
  2092.       useful only in rather special circumstances like demonstration
  2093.       BATch files while delays will get used more often.
  2094.  
  2095.             Delays are implemented as they are reached by the resident
  2096.       part of STACKEY.  The resident portion checks to see if BIOS' buffer
  2097.       is empty and only starts counting the delay if it is empty.  Thus,
  2098.       a command like
  2099.             stackey "1"W36"2"
  2100.       will separate the two keystrokes by 36 ticks as they are processed
  2101.       by your application program and not by when they happen to be
  2102.       placed in the keyboard buffer. In distinction to this, STACKEY
  2103.       implements waits as soon as they are reached in its interpretation
  2104.       of the command line.  Unlike other commands which look for an empty
  2105.       keyboard buffer, delays are not effected by whether you are in
  2106.       impatient, patient or smart mode.
  2107.  
  2108.             There are times you might want to pause a STACKEY script until
  2109.       the BIOS buffer is empty.  W1 will almost do that although it will
  2110.       delay for an extra 1 tick.  If you just want such a pause, use WB (Wait
  2111.       for Buffer).
  2112.  
  2113.             Finally, there are times that you'll want to pause a script
  2114.       until a certain absolute time.  For this, we have a resident UNtil
  2115.       command, to be distinguished from our utilities mode {UNtil..}
  2116.       command.  The resident UNtil pause a script in the background and
  2117.       lets you go about your business - at the requisite time, the script
  2118.  
  2119.  
  2120.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 39
  2121.  
  2122.  
  2123.  
  2124.  
  2125.                         Documentation for STACKEY, Version 4.0 
  2126.  
  2127.  
  2128.       continue to send in keystrokes.  The relation of UN to {UNtil...} is
  2129.       the same as the relation of the resident W command to {WAit..}.
  2130.  
  2131.             The syntax for the resident until is
  2132.                 UNhh:mm
  2133.       where hh:mm is a time.  An example would be UN10:35.  Following the
  2134.       second number, you can add a single p (for PM) and multiple n's (for
  2135.       Next day).  Thus
  2136.             UN3:35p
  2137.       is the same as UN15:35.  p must come before any n's.
  2138.  
  2139.             You can combine BATUTIL's ability to return the day of the
  2140.       week and time with the command to arrange for a batch file to place
  2141.       a resident UN until say next Saturday night.
  2142.  
  2143.  
  2144.       III.4 Scanning
  2145.  
  2146.             There are times that you will want to pause STACKEY until your
  2147.       application program takes a certain action.  If the application
  2148.       program announces that action with a message on the screen, then the
  2149.       SCan command is exactly what you want.  You can scan for either a
  2150.       "string" at a particular location on the screen for which the syntax
  2151.       is
  2152.             SCn,m(string)
  2153.       or
  2154.             SCn,m"string"
  2155.       or you can scan for the "string" immediately preceding the cursor
  2156.       position for which the syntax is
  2157.             SC(string)
  2158.       or
  2159.             SC"string"
  2160.       SC may be upper or lower case.  n,m are the row and column that you
  2161.       want to scan at.  The string will need to START at position n,m.
  2162.       For example
  2163.             stackey SC2,7(hello)"there"
  2164.       would pause stackey (while your foreground application continues to
  2165.       work) until the string hello appeared in row 2 columns 7-11 and at
  2166.       that point, "there" would be entered through the keyboard.
  2167.  
  2168.             When STACKEY runs into such a command in a script it pauses
  2169.       playback in the script while remaining in the background.  To warn you
  2170.       that this has happened, it will blink the character at the current
  2171.       cursor position for a plain SC command or at position n,m for an SCn,m
  2172.  
  2173.  
  2174.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 40
  2175.  
  2176.  
  2177.  
  2178.  
  2179.                         Documentation for STACKEY, Version 4.0 
  2180.  
  2181.  
  2182.       command.  If you do not want this blinking you can tell STACKEY to scan
  2183.       silently (i.e. without the blink) by using SS rather than SC.
  2184.  
  2185.             Be especially careful of SS, since, if the scanned element
  2186.       doesn't occur, you may forget what has happened and think that
  2187.       STACKEY is broken since further scripts are placed in the buffer but
  2188.       no action occurs since STACKEY is patiently scanning.
  2189.  
  2190.             The character ASCII 168, the upside question mark ¿ will be
  2191.       treated as a single character wildcard in any scanned string in any
  2192.       of the scan commands (including SJ and SU discussed below).  Quoted
  2193.       strings as opposed to those in (..) are useful for several reason:
  2194.       the characters ( and ) are allowed in such a string.  Moreover DOS
  2195.       does not treat < or > as redirection characters if they are between
  2196.       quotes.  Thus
  2197.             stackey SC(<Y/N?>)....
  2198.       would be a disaster since < and > would be treated as redirection
  2199.       commands!  But
  2200.             stackey SC"<Y/N?>"
  2201.       would work as you'd expect.
  2202.  
  2203.             New to version 4.0 is a branched scan were you can look for
  2204.       one of several different strings at once.  The syntax is
  2205.             SJ(string1;string2;...;stringn)
  2206.       with strings separated by semicolons.  If you choose the strings may
  2207.       be quoted inside single or double quotes.  You'd use double quotes
  2208.       if you wanted > or < and either kind of quotes if your string had a
  2209.       semicolon or a right parenthesis.  If string1 is found, the script
  2210.       jumps to label 1, if string2 to label 2, etc.  This may make scripts
  2211.       complex and you'll need to use FILEKEY.  The entire script with
  2212.       lables must fit on a single command line if you use STACKEY rather
  2213.       than FILEKEY.  Remember that the full command line is limited to 127
  2214.       characters.
  2215.  
  2216.             One of the strings in an SJ command can have the form
  2217.                 TO,nn
  2218.       in which case if nn ticks occurs without any of the search strings
  2219.       found, then STACKEY jumps to the associated label - that is TO
  2220.       stands for TimeOut.  If you need to start a search string with "to",
  2221.       use quotes on the string.  For example,
  2222.             STACKEY SJ("hi>";TO34;there) :1 BE J0 :2 BEBE J0 :3 BEBEBE J0
  2223.       would search for the strings hi> and there for 34 clock ticks.  If
  2224.       hi> was found, it would beep once; if there, then three beeps; and
  2225.       if it timed out, two beeps.  Note that if a label is not found (like
  2226.  
  2227.  
  2228.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 41
  2229.  
  2230.  
  2231.  
  2232.  
  2233.                         Documentation for STACKEY, Version 4.0 
  2234.  
  2235.  
  2236.       J0), then the script jumps to the end.
  2237.  
  2238.             You can specify an SJ at a fixed location with SJn,m(...) but
  2239.       it has to be the same location for all strings.  If you prefer a
  2240.       silent SJ, use SU in place of SJ.
  2241.  
  2242.             There are three ways to stop a STACKEY scan.  First at the DOS
  2243.       command line, you can issue
  2244.             stackey !
  2245.       which flushes the STACKEY buffer as described in Section III.10
  2246.       below.  Secondly, you can use one of two STACKEY hotkeys.  These
  2247.       are described in Section III.6 below.  One hot key flushes the
  2248.       STACKEY buffer; the other resumes playback immediately following
  2249.       the scan command.
  2250.  
  2251.             In general, it is better not to search for too long a string.
  2252.       Ideally, you want a string of 2 or 3 characters.
  2253.  
  2254.             Here is a real life example of how to use STACKEY's scan
  2255.       command.  Magellan takes some time to read all your hard disks.  If
  2256.       you load it in a Carousel partition, you'd like it to fully load in
  2257.       an initial batch command after which you switch partitions.  While
  2258.       loading, Magellan displays the word WAIT in the upper right corner
  2259.       of the screen.  When finished it changes to LIST.  The following
  2260.       will do what you'd want:
  2261.             stackey W54 SC1,76(LI) W25 Q6
  2262.             mg
  2263.       if placed in a batch file where you want to go to Carousel
  2264.       partition 6 next.
  2265.  
  2266.       III.5 The phony keystrokes
  2267.  
  2268.             Two other tools that STACKEY provides to cope with programs that
  2269.       flush their buffers after loading or even before accepting any
  2270.       input are the PHony keystroke stacked with the two key code PH as in
  2271.             stackey PH"hello"
  2272.       and the WR (wait for request) keystroke as in
  2273.             stackey WR"hello"
  2274.       When the resident part reaches such a phony keystroke, it stops
  2275.       processing the buffer until the underlying program makes any call to
  2276.       int 16.  This is the way that programs normally check for and
  2277.       process keystrokes.  The first time that a program asks if there are
  2278.       any keystrokes in the buffer, it will be told no which means that it
  2279.       won't bother to flush the buffer.  As soon as an int 16 call is
  2280.  
  2281.  
  2282.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 42
  2283.  
  2284.  
  2285.  
  2286.  
  2287.                         Documentation for STACKEY, Version 4.0 
  2288.  
  2289.  
  2290.       processed, STACKEY sets itself to continue the placing of strokes
  2291.       and processing of color commands.
  2292.  
  2293.             PH will not always work the way that you would like because a
  2294.       program may use a different strategy.  If PH didn't work for you in
  2295.       version 2.0, try WR since we have changed the strategy in a way that we
  2296.       feel is likely to be more successful.  For compatibility with
  2297.       programs for which PH worked, we have kept the version 2.0 PH but
  2298.       we believe that WR is more likely to overcome the buffer flushers.
  2299.       If you are having problems with a program flushing some of
  2300.       STACKEY's keystrokes, you can try PH but if that doesn't work, you
  2301.       can consider delays and/or using patient processing; see the
  2302.       discussion of erase *.* in the Usage notes.
  2303.  
  2304.             Alas, DOS tends to issue int 16H calls while it loads programs so
  2305.       that it will eat WRs.  You may want to find a harmless keystroke like
  2306.       Backspace and try
  2307.             stackey BS WR ....
  2308.       when loading a program.  While you can try the two commands in this
  2309.       section if nothing else works, in our experience, they don't usually
  2310.       work when other methods don't because of a recalcitrant application
  2311.       program.
  2312.  
  2313.  
  2314.       III.6 Hotkeys
  2315.  
  2316.             STACKEY provides four hotkeys to enable you to communicate
  2317.       with it from within application.  Since you can change what keys
  2318.       call them, we give a table which includes their two letter code and
  2319.       function:
  2320.  
  2321.              Code    Function         Default
  2322.             ────────────────────────────────────
  2323.              H!      Flush buffer     AL "!"
  2324.              H*      Flush scan       AL G*
  2325.              H-      Pause script     AL G-
  2326.              H+      Resume script    AL G+
  2327.  
  2328.       H! flushes the STACKEY and BIOS buffers, H* only has an effect when
  2329.       processing has stopped because of a scan (SC), a silent scan (SS), a
  2330.       keyboard scan (WS) as described in the next section or an H- pause.
  2331.       It flushes the scan command from the buffer and resumes operation on
  2332.       the next "keystroke".  H+ resumes playback of a script that has been
  2333.       paused by an H- or by the WH command that we'll discuss in the next
  2334.  
  2335.  
  2336.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 43
  2337.  
  2338.  
  2339.  
  2340.  
  2341.                         Documentation for STACKEY, Version 4.0 
  2342.  
  2343.  
  2344.       section.  Pause here just means stopping the background STACKEY
  2345.       playback; your foreground program will continue to run.
  2346.  
  2347.             The actual hotkeys that cause an action are described by two
  2348.       pieces of data: the required shift pattern given as a subset of ACLR
  2349.       (see the description of the SH command in Section II.7) and a key.
  2350.       The key is described by one of the following:
  2351.             a one character string in quotes like "a", "A" or "+"
  2352.             the following two character code that invokes normal STACKEY
  2353.                  keystrokes:
  2354.                     F1,...,F0,F-,F=, SQ, DQ, N* or G*, N+ or G+, N- or G-,
  2355.                     PS, N0,...,N9, CR, UA, DA, LA, RA, ES, BS, DE, IN,
  2356.                     PD, PU, TB, TA, EN, HM
  2357.             special two character codes for this purpose only: CL for
  2358.                  CapsLock, SL for ScrollLock, NL for NumLock and SR for
  2359.                  SysReq
  2360.       STACKEY then uses the key associated to that single stroke and
  2361.       combines it with the given shift combination. Thus "A" and "a" are
  2362.       the same for this purpose and PU and N9 are also the same. Thus to
  2363.       say that AL,"!" is the default hotkey for H! means that the buffer
  2364.       is flushed by pressing Alt+LShift+the key marked 1/!.  This is the
  2365.       same as AL,"1".
  2366.  
  2367.             You can change the hotkeys in STACKEY at any time including
  2368.       the initial loading by using the syntax
  2369.             stackey HX(YY,Z)
  2370.       where X is one of !,*,+ or -, YY is a subset of CALR and Z a key
  2371.       indicator.  For example, H+(CL,"+") would make Ctrl+LShift+top row
  2372.       plus the combination to resume playback, H!(,SR) would make the
  2373.       unshifted SysReq key flush the buffer and the following would
  2374.       restore all hotkeys to their defaults if you changed them
  2375.             stackey H!(AL,"!") H*(AL,G*) H+(AL,G+) H-(AL,G-)
  2376.  
  2377.             STACKEY uses int 9 to interpret hotkeys, that is, it directly
  2378.       reads the keyboard.  Thus you cannot include STACKEY hotkeys in
  2379.       keyboard macros and if you have used a mapping program and changed
  2380.       keytops, you'll probably find that STACKEY calls the original "A"
  2381.       key "a" and not the mapped key to which you've transferred the "A"
  2382.       keytop.
  2383.  
  2384.             STACKEY traps its hotkeys and does not pass them on.
  2385.  
  2386.             Alas, most keyboards other than IBM keyboards have some
  2387.       combinations of multiple shifts plus letters which are dead
  2388.  
  2389.  
  2390.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 44
  2391.  
  2392.  
  2393.  
  2394.  
  2395.                         Documentation for STACKEY, Version 4.0 
  2396.  
  2397.  
  2398.       combinations in that the keyboard will not issue any interrupt in
  2399.       response to them.  In particular, on some Northgate keyboards, the
  2400.       AL! default flush combination is dead.
  2401.  
  2402.  
  2403.       III.7 Pauses for keystrokes
  2404.  
  2405.             STACKEY will pause its playback (while not affecting the
  2406.       foreground program) until a particular key is struck with four
  2407.       different commands:
  2408.             WK   waits for any key to be struck or released
  2409.             WH   waits for the H+ hotkey to be hit; this is the same as
  2410.                   hitting the H- hotkey
  2411.             WS(XX,Y)  waits and scans the keyboard for a particular
  2412.                   combination
  2413.             WJ(...) multiple wait command described below.
  2414.       The keyboard scan uses the same conventions as hotkeys so that
  2415.             stackey WS(L,"a")"hello"
  2416.       will pause STACKEY playback until LShift+"a" is struck. The
  2417.       hotkeys are eaten by STACKEY and not passed on to the underlying
  2418.       application program.
  2419.  
  2420.             The syntax for the WJ command is
  2421.                 WJ(XX1,Y1;XX2,Y2;...;XXn,Yn)
  2422.       Each pair separated by semicolons consists of a shift mask and key
  2423.       as used by the WS command.  As with the SJ command, if hotkey combo
  2424.       1 is picked, the script goes to label :1, etc.  One of the
  2425.       combination can be a TO,nn combination for TimeOut with nn the
  2426.       number of ticks.  See the discussion of the SJ command.  You can use
  2427.       this command to fix multiple macros.  For example:
  2428.             stackey  :0 WJ(a,"d";a,"b") :1 $E J0 :2 BE J0
  2429.       define Alt-d to enter today's date and Alt-b to beep until you flush
  2430.       the buffer with STACKEY ! or the H! hotkey.
  2431.  
  2432.  
  2433.       III.8 Multiple STACKEY commands
  2434.  
  2435.             If you are just stacking keystrokes, you can place strokes on
  2436.       more than one line of a BATch file; that is there is no difference
  2437.       in the effect of
  2438.             stackey "hello there"
  2439.       and
  2440.             stackey "hello "
  2441.             stackey "there"
  2442.  
  2443.  
  2444.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 45
  2445.  
  2446.  
  2447.  
  2448.  
  2449.                         Documentation for STACKEY, Version 4.0 
  2450.  
  2451.  
  2452.       or even
  2453.             stackey "hello ther"
  2454.             stackey "e"
  2455.       Thus you can use separate lines for more readability or to overcome
  2456.       the length of DOS lines.  Of course with two commands, STACKEY will
  2457.       load twice but it is so small that even on a floppy based system,
  2458.       it should be in DOS' buffers and that won't slow things down.  On a
  2459.       floppy based system, extra lines in a BATch file will slow things
  2460.       down.
  2461.  
  2462.             Because utilities mode commands are processed in real time,
  2463.       there is a subtle difference between how multiple lines are
  2464.       processed when there are utilities commands on the second line but
  2465.       for virtually all situations this distinction won't matter.  Here
  2466.       is a special situation where it will:  You start on a monochrome
  2467.       monitor on a dual monitor system and issue
  2468.             stackey L4 {mon=c}
  2469.       and the monitor switch will take place before the color change. But
  2470.       with
  2471.             stackey L4
  2472.             stackey {mon=c}
  2473.       the attempted color change takes place before switching monitors
  2474.       and so have no effect.  Of course if you want to use two lines just
  2475.       reverse the order!
  2476.  
  2477.  
  2478.       III.9 Patient, impatient and smart processing
  2479.             STACKEY must cope with the fact that BIOS only provides a
  2480.       keyboard buffer of 15 strokes.  You may have software which
  2481.       enlarges this buffer for your actual typing but STACKEY cannot know
  2482.       about this.  Thus STACKEY keeps its own internal buffer.  When
  2483.       there are keystrokes waiting in this buffer, STACKEY checks 18.2
  2484.       times a second to see the state of BIOS' buffer.  Depending on the
  2485.       command and the mode you set, STACKEY will either check to see if
  2486.       the buffer is empty before placing any strokes in or will at least
  2487.       check whether there is room before placing strokes in.  STACKEY's
  2488.       inpatient mode, places as many strokes in the buffer as will fit.
  2489.       Its patient mode will place no strokes in the buffer unless the
  2490.       BIOS buffer is completely empty in which case only one stroke or
  2491.       command will be acted upon.
  2492.  
  2493.             STACKEY, by default, treats keystrokes impatiently while
  2494.       treating certain commands patiently, i.e. not implementing them
  2495.       until BIOS' stack is empty.  A typical example is a color change.
  2496.  
  2497.  
  2498.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 46
  2499.  
  2500.  
  2501.  
  2502.  
  2503.                         Documentation for STACKEY, Version 4.0 
  2504.  
  2505.  
  2506.       Temporary color changes are wiped out by a change of video mode so,
  2507.       if you are loading a program which switches into graphics mode, you
  2508.       want to be sure that the colors do not change until after the
  2509.       program has loaded and changed modes.  You can do this by
  2510.       experimenting with delay length, but if you also want to send
  2511.       keystrokes to the program, the default processing method is better.
  2512.       By preceding the color change command with some keystrokes, you can
  2513.       be sure that the color command will not be acted upon until the
  2514.       application program has loaded and no delay is necessary.  We call
  2515.       this default mode smart processing.
  2516.  
  2517.             Smart processing effects the following commands which are all
  2518.       discussed in later chapters:  Ln,Pn,+/-B and [...] (but not
  2519.       commands that change permanent palettes, i.e. [#...] commands).  It
  2520.       also effects the PS command discussed in the last chapter (PrtSc).
  2521.       The Wn delay command is always handled smartly whether or not you
  2522.       have turned smart processing on or not.
  2523.  
  2524.             There are times that you will NOT want smart processing.  For
  2525.       example, in the demonstration BATch files CGACOLOR.BAT and
  2526.       COLOR.BAT, there are commands to change colors for illustration
  2527.       purposes.  If smart processing were in effect, the color changes
  2528.       would stop if the user happens to hit a key by mistake.  For this
  2529.       reason there are commands to force impatient processing for all
  2530.       situations except Wnn commands and to turn smart processing back
  2531.       on.
  2532.             stackey /i/
  2533.       turns impatient processing on and
  2534.             stackey /s/
  2535.       turns smart processing back on.  The /i/ and /s/ must be the first
  2536.       thing on the line and we urge you to take this change seriously by
  2537.       placing only this single command on a line. Either S or s and
  2538.       either I or i are allowed.  S obviously stands for smart; I stands
  2539.       for idiotic or impatient but not for intelligent.
  2540.  
  2541.             Delays (the W command) are always treated patiently even if
  2542.       impatient mode is on.  If you are in a situation where you wish
  2543.       that the Wn command were impatient, you may find that the {wait=n}
  2544.       command is what you want.
  2545.  
  2546.             When smart processing is turned off, color commands are acted
  2547.       on as soon as they are reached.  This may not be immediately if
  2548.       BIOS' buffer completely fills and there are keystrokes ahead of the
  2549.       color command waiting to be put into BIOS' buffer.
  2550.  
  2551.  
  2552.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 47
  2553.  
  2554.  
  2555.  
  2556.  
  2557.                         Documentation for STACKEY, Version 4.0 
  2558.  
  2559.  
  2560.             Patient mode where all keystrokes are treated patiently is
  2561.       turned on with
  2562.             stackey /p/
  2563.       Since it slows down keystroke entry to only 18 per second (not much
  2564.       better than a good typist), you'll only want to use it under
  2565.       special circumstances.  Here is a typical example: the shareware
  2566.       fancy printing program BRADFORD opens by asking you the name of the
  2567.       file that you want to print followed by several questions about
  2568.       settings that you'll probably want to always answer the same way.
  2569.       This is clearly a place to use STACKEY in a BATch file with %1 as
  2570.       part of the stacked material (to be replaced by the file name).
  2571.       Alas, BRADFORD completely flushes BIOS' buffer before reading each
  2572.       and every keystroke so if STACKEY were in smart mode, all the
  2573.       strokes that you carefully arranged to have entered would be
  2574.       flushed!  But patient mode works beautifully - you need to do
  2575.       something so that the first stroke isn't entered too soon.  One
  2576.       could experiment with Wnn's but here PH works fine so the BATch
  2577.       file might read:
  2578.             stackey /p/ PH"%1"CR <more stuff>
  2579.             bradford
  2580.             stackey /s/
  2581.  
  2582.       III.10 Flushing and Quitting
  2583.  
  2584.             As long as there is room in STACKEY's internal buffer, you
  2585.       can stack additional keystrokes with a second STACKEY command, as
  2586.       we explained above.  If you enter a ! in a STACKEY command line,
  2587.       then STACKEY will flush its buffer, i.e. clear it and reset its
  2588.       internal pointer to the bottom of the stack.  It will also flush
  2589.       BIOS' buffer.  If you have an extended buffer provided by some
  2590.       other program, STACKEY will not flush that.
  2591.  
  2592.             Thus, the BATch file:
  2593.             stackey "abcdefghij1234567890"
  2594.             stackey !
  2595.       will display nothing on the screen when it is over.
  2596.  
  2597.             If STACKEY finds an ! on its command line, the interpreter
  2598.       continues processing after flushing the buffer so you may place
  2599.       other commands on the line following a !.
  2600.  
  2601.             If STACKEY finds a ; (lower case only) in its command line,
  2602.       it will quit interpreting the command line at that point.  This is
  2603.       to allow you to place comments in your BATch files.  Semi-colons
  2604.  
  2605.  
  2606.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 48
  2607.  
  2608.  
  2609.  
  2610.  
  2611.                         Documentation for STACKEY, Version 4.0 
  2612.  
  2613.  
  2614.       inside {} () or [] are interpreted as delimiters and not as comment
  2615.       indicators.
  2616.  
  2617.  
  2618.       III.11 Enlarging the Buffer
  2619.  
  2620.             STACKEY will use a default buffer allowing 128 keystrokes to
  2621.       be stacked.  The first time that STACKEY is loaded, you can tell it
  2622.       to set aside a larger buffer by including the letter B (or b;
  2623.       stands for Buffer) and the buffer size in number of strokes
  2624.       between slashes so
  2625.             stackey /B2000/"hello there"
  2626.       as an initial command would set aside a 2000 stroke buffer and then
  2627.       stack "hello there" in that buffer.  Any number between 1 and 10000
  2628.       is allowed for the buffer size.  The size is given in keystrokes;
  2629.       each keystroke requires two bytes of resident memory so a buffer
  2630.       size of 2128 would increase the amount of RAM taken by the
  2631.       resident portion of STACKEY by 4000 bytes.  If you need more than 10000
  2632.       keystrokes or want to load STACKEY in high DOS memory, use the SKRES
  2633.       program described in the next section.
  2634.  
  2635.             Once STACKEY is loaded it cannot change the size of the
  2636.       buffer in the loaded copy.  Further calls to STACKEY find the
  2637.       resident copy and use it and do not load another copy.  If a copy
  2638.       is loaded and /Bxxxx/ appears on the command line, you will get an
  2639.       error message.  You can however choose to load a new copy of
  2640.       STACKEY with any buffer size you want.  The old copy remains in
  2641.       memory but will be unused; STACKEY always finds the last copy
  2642.       loaded in memory.  You tell STACKEY to load a new copy by placing
  2643.       an R (or r; stands for Reload) after the first / in the buffer
  2644.       size command so
  2645.             stackey /R2000/"hello there"
  2646.       will load a new copy of STACKEY with a 2000 stroke buffer.  Even if
  2647.       STACKEY has not already been loaded, you can load it with the
  2648.       /R.../ command.
  2649.  
  2650.             Both the /B.../ and the /R.../ commands must be the first
  2651.       thing on the command line after the name STACKEY; this is also true
  2652.       of the other /.../ commands that we will describe.  You cannot
  2653.       place more than one set of /'s on a line.  However, you can place
  2654.       multiple /../ commands within one set of brackets such as
  2655.             stackey /R2000 T I/
  2656.       which would load a new copy and turn on testing mode and off smart
  2657.       mode in this new copy (of course, stackey /T I R2000/ will first
  2658.  
  2659.  
  2660.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 49
  2661.  
  2662.  
  2663.  
  2664.  
  2665.                         Documentation for STACKEY, Version 4.0 
  2666.  
  2667.  
  2668.       change the modes in the old copy and then load the new copy,
  2669.       probably not what you wanted).
  2670.  
  2671.             If STACKEY cannot fit the characters on the command line into
  2672.       it internal buffer, it prints an error message, showing you where
  2673.       the overflow occurs, beeps and places NO new characters in the
  2674.       buffer.  The beep is sent to standard output and so it may be
  2675.       redirected to nul.  The errorlevel is set to 2.  In the default
  2676.       setting STACKEY will also flush the buffer when there is an error;
  2677.       see the discussion of continue mode below.
  2678.  
  2679.  
  2680.       III.12 The SKRES program
  2681.  
  2682.             A separate program is provided whose sole purpose is to load
  2683.       STACKEY the first time.  It does not do additional command line
  2684.       processing so that you cannot include your first set of STACKEY
  2685.       commands.  It is intended for use in two circumstances: when you want a
  2686.       buffer larger than 10,000 keystrokes and when loading in a small area
  2687.       of high DOS memory.
  2688.  
  2689.             STACKEY itself will only load with a buffer of up to 10,000
  2690.       keystrokes (20,000 bytes).  SKRES allows up to 30,000 keystrokes
  2691.       (60,000 bytes).  If you wonder how one could want a buffer over
  2692.       10,000 strokes, so do we but we received the request from some
  2693.       users with large FILEKEY scripts.  The syntax is identical to that
  2694.       for STACKEY so that, for example
  2695.             skres /B30000/
  2696.       would load with the maximal buffer size.
  2697.  
  2698.             Users of 386max, QEMM, Move 'em, QRAM and other programs that
  2699.       let you load TSRs into nooks and crannies of free address space in
  2700.       the region between 640K and 1 meg, often want to load STACKEY into
  2701.       a small space.  Even though STACKEY's resident part takes under
  2702.       1.7K, loading the program and initializing it takes over 23K and
  2703.       you'll need that much free to load STACKEY.  SKRES leaves out the
  2704.       interpreter precisely to make it as small as possible so we
  2705.       recommend using it if you wish to load STACKEY's resident part into
  2706.       high memory. If skres is used, the only allowed command on its
  2707.       command line is /Bxxxx/.
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 50
  2715.  
  2716.  
  2717.  
  2718.  
  2719.                         Documentation for STACKEY, Version 4.0 
  2720.  
  2721.  
  2722.       III.13 Test mode
  2723.  
  2724.             STACKEY is a powerful program.  For that reason, especially
  2725.       while debugging a BATch file, you may want to abort a BATch file
  2726.       after STACKEY displays an error message.  STACKEY has a special
  2727.       "test mode" which you invoke with
  2728.             stackey /T/
  2729.       Whenever, STACKEY issues an error message, it checks whether test
  2730.       mode is on.  If it is, it will pause processing of the BATch file
  2731.       and issue the message
  2732.             STACKEY: Abort (Y/N)?
  2733.       If you answer Y, STACKEY will place a ^C in BIOS' buffer which will
  2734.       normally cause the BATch file to ask
  2735.             Terminate batch job (Y/N)?
  2736.       and Y will stop the BATch file.  This message from STACKEY cannot
  2737.       be redirected.
  2738.  
  2739.             To be sure that you are the one to answer the Abort message,
  2740.       STACKEY flushes both BIOS' buffer and its own.
  2741.  
  2742.             To turn off test mode and restore normal processing issue
  2743.             stackey /N/
  2744.       Some users may prefer to always use test mode.
  2745.  
  2746.             While /N/ and /T/ need only be the first commands on the
  2747.       line, we suggest that you make them the only commands on the line.
  2748.  
  2749.             In order for ^C to stop the BATch file and ask "Terminate
  2750.       batch job (Y/N)?", you must have Break on.  For this reason, if
  2751.       STACKEY is in testing mode, you respond Y to "STACKEY: Abort
  2752.       (Y/N)?" and Break is off, STACKEY will turn Break on and tell you
  2753.       that it has done so.
  2754.  
  2755.  
  2756.       III.14 Continue mode
  2757.  
  2758.             If there is an error in STACKEY's command line but there are
  2759.       keystrokes pending then STACKEY, by default, assumes that you want
  2760.       the current processing aborted and it flushes both its buffer and
  2761.       BIOS' buffer.  If for some reason, you don't want this done, you
  2762.       can issue the command
  2763.             stackey /c/
  2764.       (C or c for continue).  To restore the default setting use
  2765.             stackey /d/
  2766.  
  2767.  
  2768.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 51
  2769.  
  2770.  
  2771.  
  2772.  
  2773.                         Documentation for STACKEY, Version 4.0 
  2774.  
  2775.  
  2776.       (D or d for discontinue).  When continue mode is on, not only will
  2777.       what is in STACKEY's buffer at the time of the erroneous line still
  2778.       be processed but the parts of the line up to the error are also
  2779.       processed.
  2780.  
  2781.             If test mode is on, STACKEY flushes the buffer automatically
  2782.       before displaying its "Abort(Y/N)?" message; thus, if testing mode
  2783.       is on, the setting of C/D will be overridden.
  2784.  
  2785.  
  2786.       III.15 Pushing, popping and querying the flags
  2787.  
  2788.             STACKEY uses several flags to keep track of the current state
  2789.       of the following toggles: Normal vs. Test mode, Smart vs. Impatient
  2790.       vs. Patient processing, Continue vs. Discontinue on error.  You can
  2791.       save this combined state and the with
  2792.             stackey /u/
  2793.       and restore from the last command of this type with
  2794.             stackey /o/
  2795.       These commands pUsh and pOp the STACKEY flags.  The initial value
  2796.       of the pushed flags is the default and only one set is pushed so
  2797.       that popping does not change the pushed values.
  2798.  
  2799.             These commands are included for you to employ if you make
  2800.       demonstration BATch files with STACKEY.  You may want to turn off
  2801.       smart processing but you can't just restore smart processing since
  2802.       the user may have turned it off.  As a courtesy, if you are making
  2803.       demonstration BATch files to be used by others and you change the
  2804.       STACKEY flags, please push them at the start and pop them at the
  2805.       end.  Since we can find no reason for you to change the hotkeys, we
  2806.       don't save their state in a push.  If you want to use a WH command
  2807.       but are unsure what to tell the user to push to resume, use WS
  2808.       instead.
  2809.  
  2810.             At any time, the command
  2811.             stackey /?/
  2812.       will send the version number, the current values of the STACKEY
  2813.       flags, the four current hotkeys and the buffer size of the active
  2814.       copy to standard output.  The state of the hotkeys output takes the
  2815.       form
  2816.             Hotkeys H!, H*, H+, H- are:  (LA,"!")  (LA,n*)  (LA,n+)  (LA,n-)
  2817.       where the indication is (set of shifts, keyname).  Be forewarned
  2818.       that one particular keyname is picked when there are several e.g.
  2819.       TB rather than TA.
  2820.  
  2821.  
  2822.       Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 52
  2823.  
  2824.  
  2825.  
  2826.  
  2827.                            Chapter IV:SETTING COLORS
  2828.  
  2829.       IV.1 Color Basics: Introduction
  2830.  
  2831.             Color monitors on an IBM PC provide graphics as well as
  2832.       colors but unfortunately the attitude of the authors of many
  2833.       graphics programs seems to be that you can have any two colors you
  2834.       want so long as you want white on black.  STACKEY has tools which
  2835.       allow you to set colors on a color monitor even for programs that
  2836.       set no colors or set colors that you don't like.  There are
  2837.       separate tools for the IBM Color Graphics Adapter (CGA) and the
  2838.       Enhanced Graphics Adapter (EGA).  The EGA compatible modes of the
  2839.       VGA are supported but the new 256 color VGA modes are not supported.
  2840.       CGA users should read through the section on SETTING COLORS ON THE CGA
  2841.       and can then skip to the next chapter.  EGA users can skip the section
  2842.       on SETTING COLORS ON THE CGA but should read all the sections on color
  2843.       basics.  Special support is provided for users of Ultravision.
  2844.  
  2845.  
  2846.       IV.2 Color Basics: Graphics modes
  2847.  
  2848.             The amount of color you can have depends not only on the
  2849.       adapter but also on the particular mode.  The CGA supports
  2850.       essentially three modes:
  2851.             Text mode (mode 3 for 80 columns)
  2852.             CGA Medium Resolution mode (mode 4)
  2853.             CGA High Resolution mode (mode 6)
  2854.       Mode 3 allows 16 background colors and (normally) 8 foreground
  2855.       colors.  Mode 4 has a resolution of 320x200 and allows four colors,
  2856.       a background color which can be from among 16 possible choices and
  2857.       one of two palettes of three colors.  Mode 6 has a resolution of
  2858.       640x200 and two colors, a black background and a foreground chosen
  2859.       from among 16 choices.
  2860.  
  2861.             The EGA supports two additional modes:
  2862.             EGA medium resolution (mode 14)
  2863.             EGA high resolution (mode 16)
  2864.       Each mode is a sixteen color mode (at least if your EGA card has a
  2865.       full 256K of memory).  Mode 14 has resolution of 640x200 just like
  2866.       mode 6 (so why use mode 6? Simple, if you're the programmer; you
  2867.       can write one program for the CGA and the EGA.  If you're the user,
  2868.       there is no reason to want mode 6 over mode 14 except if you like
  2869.       programs written by lazy programmers!).  Mode 16 has the full
  2870.       640x350 resolution supported by the EGA.
  2871.  
  2872.             The VGA supports two modes more than the EGA:
  2873.             256 color medium resolution (mode 19)
  2874.  
  2875.  
  2876.       Chapter IV:SETTING COLORS                                  page 53
  2877.  
  2878.  
  2879.  
  2880.  
  2881.                         Documentation for STACKEY, Version 4.0 
  2882.  
  2883.  
  2884.             VGA high resolution (mode 18)
  2885.       VGA high resolution is 640x480.  Mode 19 is much lower resolution
  2886.       (320x200) but has 256 colors out of a palette of 262,144 rather
  2887.       than the 16 colors out of 64 allowed by the EGA or the other VGA
  2888.       modes.  There is a tradeoff between number of colors and apparent
  2889.       resolution.  Television makers have known for a long time that many
  2890.       colors can fool the viewer into thinking the resolution is higher
  2891.       than it actually is.  Even though it is low resolution, graphics in
  2892.       mode 19 can be quite striking.
  2893.  
  2894.             Various so called superVGA cards, most notably those from
  2895.       Paradise and Video7 support 800x600 resolution and 256 colors with
  2896.       640x480.  Alas there is not yet a common standard so STACKEY does not
  2897.       have support for these superVGA modes.
  2898.  
  2899.             Actually, we have not included in this discussion the 40
  2900.       column text mode (mode 1 supported on the CGA and the EGA) nor the
  2901.       16 color 320x200 EGA mode (mode 13) nor the two color graphic
  2902.       modes 15 and 17 which are rarely used.
  2903.  
  2904.             If you have the full 256K memory and an enhanced color
  2905.       display, you can choose these 16 colors from among an array of 64.
  2906.       Of this, more later.
  2907.  
  2908.             Borders further complicate the possibilities.  The CGA allows
  2909.       a border in text mode.  While the EGA does also, the only
  2910.       description of the text mode border is wimpy.  In mode 4 on the
  2911.       CGA, the border is the same color as the background.  On the EGA,
  2912.       you can specify a border color differently from the background and
  2913.       it is a full border.  The same is true in mode 14.
  2914.  
  2915.             It is important to realize that a mode change will reset the
  2916.       colors to their default values (this is not always quite true on
  2917.       the EGA/VGA; see the discussion of permanent colors later).
  2918.  
  2919.  
  2920.       IV.3 Color Basics: CGA color choices
  2921.  
  2922.             The sixteen colors on the CGA are numbered as follows:
  2923.       0(0H)       Black                  8(8H)I      Dark Grey
  2924.       1(1H)   B   Blue                   9(9H)I  B   Intense Blue
  2925.       2(2H)  G    Green                 10(AH)I G    Intense Green
  2926.       3(3H)  GB   Cyan                  11(BH)I GB   Intense Cyan
  2927.       4(4H) R     Red                   12(CH)IR     Intense Red
  2928.  
  2929.  
  2930.       Chapter IV:SETTING COLORS                                  page 54
  2931.  
  2932.  
  2933.  
  2934.  
  2935.                         Documentation for STACKEY, Version 4.0 
  2936.  
  2937.  
  2938.       5(5H) R B   Magenta               13(DH)IR B   Intense Magenta
  2939.       6(6H) RG    Brown                 14(EH)IRG    Yellow
  2940.       7(7H) RGB   Light Grey            15(FH)IRGB   White
  2941.             After the decimal number, we give its hex value.  The
  2942.       letters I,R,G,B describe the color in terms of 4 basic on/off
  2943.       switches determining the color: the Intensity, Red, Green and Blue
  2944.       switches.  Thus cyan is a mix of Green and Blue.  The intensity bit
  2945.       is a misnomer in that Dark Grey is not what one would think of as
  2946.       "Intense Black"; I is really a brightness and so an intenseness of
  2947.       light.  There is a connection between the IRGB switches and the
  2948.       color number.  If B has the value 1, G the value 2, R the value 4
  2949.       and I the value 8, then the CGA color value is arrived at by adding
  2950.       the values of the switches that are on.  Thus intense magenta which
  2951.       is IRB is color number 8+4+1=13.
  2952.  
  2953.  
  2954.       IV.4 Setting colors on the CGA
  2955.  
  2956.             CGA colors are set using STACKEY with two commands the L (for
  2957.       coLor) and the P for Palette command.  The P command only has effect
  2958.       in mode 4 (CGA medium resolution graphics) while the L command has a
  2959.       effect in any mode.  It is IMPORTANT that the color command only get
  2960.       issued by STACKEY after the mode has changed and to do this you may
  2961.       have to add waits and experiment with their lengths.  For example,
  2962.       if you load a program which switches to mode 4 and want a red
  2963.       background, the command
  2964.             stackey L4
  2965.       in a BATch file immediately before the line loading the program
  2966.       will not work.  Rather, the L4 command will get issued by the
  2967.       resident portion of STACKEY immediately and change the border to
  2968.       red while you are still in text mode.  The graphics program will
  2969.       then load and change modes thereby wiping out the color change you
  2970.       issued.  Instead, you should try
  2971.             stackey W36L4
  2972.       which will tell the resident portion of STACKEY to wait roughly 2
  2973.       seconds before issuing the color change command.  While this wait
  2974.       is going on, control will be passed to the application which can
  2975.       load and change modes.  If the W36 is a long enough wait, the color
  2976.       change will only take effect after the application program has
  2977.       changed modes.  But you will have to experiment to see how long a
  2978.       wait you need to put in.
  2979.  
  2980.             If you are also stacking keystrokes which will only be
  2981.       processed by the application program after it changes modes, you do
  2982.  
  2983.  
  2984.       Chapter IV:SETTING COLORS                                  page 55
  2985.  
  2986.  
  2987.  
  2988.  
  2989.                         Documentation for STACKEY, Version 4.0 
  2990.  
  2991.  
  2992.       not need to stack a wait, for STACKEY only acts on the L command if
  2993.       the keyboard buffer is empty, that is if there are no strokes
  2994.       waiting for a program to process.  Even if you don't want to stack
  2995.       keystrokes, it may be easier to stack a harmless keystroke (like
  2996.       backspace) rather than experiment with delays of appropriate length.
  2997.       Depending on the program, you may be able to use PH or WR as the
  2998.       harmless keystroke.   In BATch files, you may want to turn smart
  2999.       processing (reading the buffer to check that it is empty before issuing
  3000.       a color command) off using the /i/ command discussed in Chapter III.
  3001.       Be sure to turn smart processing back on with /s/.
  3002.  
  3003.             What the coLor command does depends on mode:
  3004.             In text mode (modes 1 and 3) Ln sets the border color to n
  3005.             In medium resolution mode (mode 4) Ln sets the background to
  3006.       color n
  3007.             In high resolution node (mode 6) Ln sets the foreground color
  3008.       to color n
  3009.  
  3010.             If this choice seems odd, it is essentially the single
  3011.       globally chosen color available in each mode.  Each mode allows 16
  3012.       choices for n.  STACKEY will accept any integer value and compute n
  3013.       modulo 16.  The demonstration BATch file CGACOLOR.BAT will
  3014.       illustrate the abilities of STACKEY on the CGA.
  3015.  
  3016.             The medium resolution mode on the CGA (mode 4) is a four
  3017.       color mode.  In addition to the background color, there is a choice
  3018.       of one of two palettes:
  3019.             Palette 0: green, red, brown (color numbers 2,4,6)
  3020.             Palette 1: cyan, magenta, grey (color numbers 3,5,7)
  3021.       The default is palette 1.  You can change palettes with the P
  3022.       command.  Pn will change to palette n where n must be 0 or 1.  Like
  3023.       the L command, when smart processing is on, STACKEY will wait for
  3024.       an empty buffer before implementing the palette change.
  3025.  
  3026.             Example: To change to palette 0 on a red background, just
  3027.       before loading a program changing to mode 4 issue
  3028.             stackey W36L4P0
  3029.  
  3030.             Unfortunately, if you set colors for graphics mode with
  3031.       STACKEY and then call up a resident program that works in text mode
  3032.       like SIDEKICK (TM), when the resident program exits and you return
  3033.       to graphics mode, you will have lost your color settings. CTRLALT
  3034.       PLUS enables you to reset these color settings.
  3035.  
  3036.  
  3037.  
  3038.       Chapter IV:SETTING COLORS                                  page 56
  3039.  
  3040.  
  3041.  
  3042.  
  3043.                         Documentation for STACKEY, Version 4.0 
  3044.  
  3045.  
  3046.       IV.5 Color Basics: EGA color slots and palettes
  3047.  
  3048.             The EGA/VGA carries color setting a step further than on the
  3049.       CGA.  The graphics modes special to the EGA and also the normal
  3050.       text mode are capable of showing 16 colors but those 16 colors can
  3051.       be chosen from among 64 in modes 3 and 16.  Thus the 16 choices
  3052.       should be viewed as "color slots".  Into each slot, one can map any
  3053.       one of the 64.  In the default situation, the color slots are
  3054.       filled by colors identical to the ones on the CGA but with suitable
  3055.       software (like STACKEY!), the user can change the assignment of
  3056.       colors to slots.  Such an assignment is called a palette.
  3057.       Sometimes what we are calling color slots are called palette
  3058.       numbers and the numbers we will call color labels are called
  3059.       palette parameters.
  3060.  
  3061.             The total number of palettes is approximately 8 times 10
  3062.       raised to 28th power.  To appreciate how large this number is, we
  3063.       note that if every PC in the world were equipped with an EGA and
  3064.       could check out a billion distinct possibilities each second, it
  3065.       would takes millions of years to complete the exploration of all
  3066.       the palettes.
  3067.  
  3068.  
  3069.       IV.6 Color Basics: EGA color labelling
  3070.  
  3071.             Each individual color among the 64 is gotten by blending a
  3072.       level of red, green and blue.  Each primary color can be mixed in
  3073.       at one of 4 levels (so 64=4x4x4).  Alternatively, one thinks of a
  3074.       strong red bit and a weak red bit whose presence are indicated R
  3075.       and r.  Thus, the four levels of red are none, r, R and Rr.
  3076.       Similarly, there is no blue, b, B, Bb and no green, g, G and Gg.
  3077.       Each color can be associated to a mixture of the six letters rRgGbB
  3078.       and is assigned a number by using the following values:
  3079.             B=1,G=2,R=4,b=8,g=16,r=32
  3080.       Thus, for example Rg has the value 4+16=20.  With one exception,
  3081.       the default colors are taken by looking at the CGA IRGB labels and
  3082.       replacing I by rgb.  The exception is brown in color slot 6 which
  3083.       is RG in CGA and translates to Rg in EGA.
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.       Chapter IV:SETTING COLORS                                  page 57
  3093.  
  3094.  
  3095.  
  3096.  
  3097.                         Documentation for STACKEY, Version 4.0 
  3098.  
  3099.  
  3100.             To help you in exploring the colors, we have attempted to
  3101.       give them names:
  3102.  
  3103.  0(00H)        black*            32(20H) r       faint red
  3104.  1(01H)    B   blue*             33(21H) r  B    looks blue to me
  3105.  2(02H)  G     green*            34(22H) rG      looks green to me
  3106.  3(03H)  G B   cyan*             35(23H) rG B    looks cyan to me
  3107.  4(04H)R       red*              36(24H)Rr       bright red
  3108.  5(05H)R   B   magenta*          37(25H)Rr  B    hot pink
  3109.  6(06H)R G     pea green         38(26H)RrG      orange
  3110.  7(07H)R G B   grey*             39(27H)RrG B    flesh pink
  3111.  8(08H)     b  navy blue         40(28H) r   b   royal purple
  3112.  9(09H)    Bb  bright blue       41(29H) r  Bb   looks bright blue to me
  3113. 10(0AH)  G  b  glade green       42(2AH) rG  b   looks glade green to me
  3114. 11(0BH)  G Bb  powder blue       43(2BH) rG Bb   looks powder blue to me
  3115. 12(0CH)R    b  maroon            44(2CH)Rr   b   lox (smoked salmon)
  3116. 13(0DH)R   Bb  lilac             45(2DH)Rr  Bb   bright lilac
  3117. 14(0EH)R G  b  khaki             46(2EH)RrG  b   peach
  3118. 15(0FH)R G Bb  blue grey         47(2FH)RrG Bb   light lilac
  3119. 16(10H)   g    forest green      48(30H) r g     looks forest green to me
  3120. 17(11H)   gB   steel blue        49(31H) r gB    looks steel blue to me
  3121. 18(12H)  Gg    bright green      50(32H) rGg     looks bright green to me
  3122. 19(13H)  GgB   cyan green        51(33H) rGgB    looks cyan green to me
  3123. 20(14H)R  g    brown*            52(34H)Rr g     vermilion (red orange)
  3124. 21(15H)R  gB   lavender          53(35H)Rr gB    pale hot pink
  3125. 22(16H)R Gg    lime green        54(36H)RrGg     canary yellow
  3126. 23(17H)R GgB   bright cyan green 55(37H)RrGgB    cream
  3127. 24(18H)   g b  steel grey        56(38H) r g b   dark grey*
  3128. 25(19H)   gBb  cyanic blue       57(39H) r gBb   intense blue*
  3129. 26(1AH)  Gg b  intense cyan green58(3AH) rGg b   intense green*
  3130. 27(1BH)  GgBb  bright cyan       59(3BH) rGgBb   intense cyan*
  3131. 28(1CH)R  g b  chocolate brown   60(3CH)Rr g b   intense red*
  3132. 29(1DH)R  gBb  bright lilac      61(3DH)Rr gBb   intense magenta*
  3133. 30(1EH)R Gg b  bright lime green 62(3EH)RrGg b   yellow*
  3134. 31(1FH)R GgBb  bright cyan       63(3FH)RrGgBb   white*
  3135.  
  3136.             The default colors are indicated with a *.  We feel that the
  3137.       tolerable choices for background colors include blue(1), maroon
  3138.       (12), steel grey (24) and forest green (16).  Particularly
  3139.       interesting colors include  chocolate brown (28), hot pink (37),
  3140.       orange (38), lox (44), peach (46) and vermilion (52).  Among the
  3141.       combinations we like for text in graphics mode are cream on maroon
  3142.       (55 on 12) and bright cyan on blue (27 on 1).  The demonstration
  3143.       BATch files color.bat and seecolor.bat, described later allow you
  3144.  
  3145.  
  3146.       Chapter IV:SETTING COLORS                                  page 58
  3147.  
  3148.  
  3149.  
  3150.  
  3151.                         Documentation for STACKEY, Version 4.0 
  3152.  
  3153.  
  3154.       to explore the EGA color combinations.  They require an EGA or VGA
  3155.       connected to an Enhanced Color Display or VGA monitor or equivalent.
  3156.  
  3157.             A palette on the EGA is thus the assignment to each color
  3158.       slot of one of the 64 color values.  This is also called a color
  3159.       mapping.  If you have mapped blue into the slot normally occupied
  3160.       by black and yellow into the slot normally occupied by grey, your
  3161.       dumb program will think it is displaying vibrant grey on black for
  3162.       you but you'll see yellow on blue.  Later we'll see how to make
  3163.       this kind of mapping with STACKEY.  While color mapping is possible
  3164.       in modes 4,6 and 14, you don't have 64 colors to choose from and
  3165.       the g and b parameters have no effect on colors in those modes.
  3166.  
  3167.  
  3168.       IV.7 Color Basics: EGA borders
  3169.  
  3170.             In addition to the sixteen colors that you can display on the
  3171.       EGA (in modes 3,13,14,16), there is a choice of border color.  While
  3172.       in principle you can set a border in any mode, the border in the
  3173.       350 line modes (modes 1,3,16) is so wimpy, you won't want to use
  3174.       it.  But the border is a full one in modes 4,6,13,14.  Unlike the
  3175.       CGA which forces the same color for background and border in mode
  3176.       4, the EGA allows these colors to be different.  The technical name
  3177.       for the border is overscan and the corresponding slot is called the
  3178.       "overscan byte".
  3179.  
  3180.  
  3181.       IV.8 Color Basics: EGA hardware considerations
  3182.  
  3183.             All our discussion has been for the EGA with 256K attached to
  3184.       an enhanced color display or equivalent.  There are some
  3185.       differences if you have less memory or an ordinary color monitor
  3186.       attached to your system.  With 64K on your EGA, even with an ECD
  3187.       you can only display four colors from a set of 16 in mode 16 (high
  3188.       res EGA graphics).  The available slots are 0,1,4,7.
  3189.  
  3190.             An ordinary color monitor attached to an EGA does not support
  3191.       mode 16 and does not support any colors but the standard 16.  We
  3192.       believe that color mapping is possible with this setup but have not
  3193.       tested it out.
  3194.  
  3195.             There is unfortunately quite a bit of variation between hues
  3196.       on different sets of the same hardware and even greater variation
  3197.       if you are using an ECD clone rather than the IBM version.  In
  3198.  
  3199.  
  3200.       Chapter IV:SETTING COLORS                                  page 59
  3201.  
  3202.  
  3203.  
  3204.  
  3205.                         Documentation for STACKEY, Version 4.0 
  3206.  
  3207.  
  3208.       particular, colors 33 and 1 will look exactly alike on some
  3209.       machines and at least slightly different on others.
  3210.  
  3211.       IV.9 Setting colors on the EGA or VGA
  3212.  
  3213.             STACKEY lets you make an arbitrary mapping of colors to color
  3214.       slots.  The syntax is to place the color commands inside [].  The
  3215.       command
  3216.             stackey []
  3217.       resets the palettes to the default.  Otherwise inside [], use c=nn
  3218.       where c is either a number from 0 to 15 and represents the color
  3219.       slot or the letter o (or cap O) if you want to change the overscan
  3220.       byte.  nn can either be a number from 0 to 63 or a string of up to
  3221.       six characters from rRgGbB.  Thus
  3222.             stackey [0=62]
  3223.       and
  3224.             stackey [0=RrGgb]
  3225.       do the same thing, namely place yellow in color slot zero.
  3226.  
  3227.             As is the case for delays and CGA colors, the [] command will
  3228.       only be implemented when there is an empty keyboard buffer.  This
  3229.       means that if you are also placing keystrokes in the buffer which
  3230.       will only be absorbed after your application loads and changes
  3231.       mode, you need not (and should not) place a wait in the command
  3232.       line.  For special situations you may want to turn this smart
  3233.       processing on and off with the /p/, /s/ and /i/ commands discussed
  3234.       in Chapter III.
  3235.  
  3236.             If you do not have an EGA or VGA installed and attached to a
  3237.       color monitor, then STACKEY will issue an error message if any
  3238.       command with a [ is attempted.
  3239.  
  3240.             Several changes separated by commas, spaces or semicolons can
  3241.       be used inside a single pair of brackets.
  3242.  
  3243.             Example: It's Halloween so you want black on orange in text
  3244.       mode.  Normally your colors are the default grey on black (shame on
  3245.       you!).  Enter
  3246.             stackey [0=38,7=0]
  3247.  
  3248.             Example: You want to call up REFLEX 1.0 on the EGA from a BATch
  3249.       file REFL.BAT which first of all loads a file specified on the command
  3250.       line (normally, you'd have to hit / for menu, p for print/file submenu,
  3251.       r for read, enter the file name and hit <Enter> twice).  You also want
  3252.  
  3253.  
  3254.       Chapter IV:SETTING COLORS                                  page 60
  3255.  
  3256.  
  3257.  
  3258.  
  3259.                         Documentation for STACKEY, Version 4.0 
  3260.  
  3261.  
  3262.       to change REFLEX's default colors (white on black, shame on BORLAND;
  3263.       colors have been fixed in Reflex 2.0 - hooray for Borland) to cream on
  3264.       maroon.  Your BATch file should read:
  3265.             echo off
  3266.             cls
  3267.             C:
  3268.             cd\reflex
  3269.             stackey "/pr%1"CRCR[0=12,15=55]
  3270.             reflex
  3271.       Probably you should include special handling if %1 is the empty
  3272.       variable.  If you were not placing keystrokes in the buffer, it
  3273.       would be essential to put a delay in such as
  3274.             stackey W150[0=12,15=55]
  3275.       to make sure that REFLEX has changed modes before the color change
  3276.       command takes effect.  With a stroke in the buffer, the color
  3277.       change is only implemented after REFLEX loads and processes those
  3278.       strokes.  If you have turned off smart processing, then waits will
  3279.       be necessary.
  3280.  
  3281.             Example:  Your colors are normally yellow on blue set with
  3282.       your prompt.  You want to have bright blue on lilac for text today.
  3283.       Use
  3284.             stackey [1=RBb,14=Bb]
  3285.       (We don't particularly like this combination, mind you).
  3286.  
  3287.             Example:  You want to call up a program using mode 6 graphics
  3288.       and want a cyanic blue border and blue on cyan text area.  Use
  3289.             stackey [o=gBb,0=BG,1=B]
  3290.       Yes, it is 1=B and not 7=B.  The foreground in mode 6 is color slot
  3291.       1 even though it defaults to grey.  Similarly, the foreground in
  3292.       mode 4 defaults to color slot 3.
  3293.  
  3294.             Note for users of Ultravision: In order for the temporary
  3295.       palette commands to work, if you have Ultravision installed and
  3296.       call for a [] color change, then STACKEY will turn off Ultravision
  3297.       palette locking and you will not be able to set colors with
  3298.       Ultravision without turning it back on either with a [#U..] command
  3299.       (see the next section) or from the Ultravision main menu.  CTRLALT
  3300.       PLUS' resident palette setting will only work if Ultravision's
  3301.       palette locking is turned off.
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.       Chapter IV:SETTING COLORS                                  page 61
  3309.  
  3310.  
  3311.  
  3312.  
  3313.                         Documentation for STACKEY, Version 4.0 
  3314.  
  3315.  
  3316.       IV.10 Setting permanent colors on the EGA/VGA
  3317.  
  3318.             Every time the mode is changed the colors get reset by the
  3319.       EGA/VGA to their default value.  A mechanism is provided to change
  3320.       the default values to which they are reset.  These changes are made
  3321.       only for the current session on your computer.  The values are
  3322.       changed to their "real" defaults whenever you reboot.
  3323.       Nevertheless, since the choices do persist through mode changes
  3324.       they are called permanent.  Unfortunately, the place where these
  3325.       permanent palettes are kept is in ROM where they cannot be changed
  3326.       by the user or any program!  It is possible to set aside a region
  3327.       of RAM which is read instead of ROM for permanent color changes.
  3328.       Once the permanent colors are stored there, it is possible to have
  3329.       a program that changes them.  As we will describe in Chapter VII,
  3330.       the programs EGAPAL and VGAPAL set up such a region in RAM.
  3331.       STACKEY's permanent palette setting only works with one of these
  3332.       programs or with Ultravision.
  3333.  
  3334.             The syntax is
  3335.                 stackey [#m,c=nn]
  3336.       where m is the mode number in decimal.  Thus to arrange that mode
  3337.       16 always comes up with black mapped to maroon and white to cream
  3338.       use
  3339.             stackey [#16,0=12,15=55]
  3340.       As usual, the comma can be replaced by spaces or semicolons. You can
  3341.       change the permanent colors back to the default by using
  3342.             stackey [#m]
  3343.       If you replace m by A, STACKEY will make the changes to all
  3344.       palettes and, in particular
  3345.             stackey [#A]
  3346.       resets all the permanent palettes.  Acceptable values of m are
  3347.       1,3,4,6,13,14,16 and A.  Any other value, or an attempt to use this
  3348.       service without an EGA or VGA will result in the error message:
  3349.             VGAPAL is not installed
  3350.       on a VGA and similarly on an EGA.
  3351.  
  3352.             On an EGA, separate palettes are kept for each mode.  Only
  3353.       one #n is allowed within a single bracket.
  3354.  
  3355.             On a VGA only a single palette is kept.  You can set the
  3356.       palette for multiple modes with multiple uses of # sign as in
  3357.             [#3 #16 1=4,2=13]
  3358.  
  3359.  
  3360.  
  3361.  
  3362.       Chapter IV:SETTING COLORS                                  page 62
  3363.  
  3364.  
  3365.  
  3366.  
  3367.                         Documentation for STACKEY, Version 4.0 
  3368.  
  3369.  
  3370.             If Ultravision is installed, you will get an error message if
  3371.       you try to use [#n..] or [#A..].  Instead you need to use [#U..] or
  3372.       [#T..]. This tells STACKEY to turn on Ultravision's palette locking
  3373.       and set its palette.  The difference between the two ultravision
  3374.       commands is that #T turns on Ultravision's palette locking only in
  3375.       text mode while #U turns it on in all modes.
  3376.  
  3377.             The color slot and color label must appear on either side of
  3378.       the equal sign with no spaces allowed.  Between different color
  3379.       settings in a multiple setting command you must place a delimiter
  3380.       (comma, semicolon or space).
  3381.  
  3382.             The permanent changes are made in "real time", that is as
  3383.       soon that part of the STACKEY command line is interpreted.  Thus
  3384.       they are not postponed by previous delays (the Wn) command although
  3385.       they are postponed by waits (the {Wait n} command). In particular,
  3386.       permanent palette changes are not delayed until there is an empty
  3387.       buffer as is the case with temporary color changes when smart
  3388.       processing is turned on (the default).
  3389.  
  3390.             You may not stack both temporary and permanent changes in
  3391.       the same bracket. Permanent changes can only be made if # is the
  3392.       first symbol immediately following [.  A delimiter (comma,
  3393.       semicolon or space) must separate the color slot numbers.  While
  3394.       you cannot place permanent and temporary changes inside of the same
  3395.       set of [], there is no reason that you can't place more than one
  3396.       set of [] on one command line with some temporary changes in one []
  3397.       and some permanent changes in the other.
  3398.  
  3399.             Color palettes made "permanent" will be properly restored by
  3400.       your popup programs when they exit.
  3401.  
  3402.       IV.11 Controlling the blinking bit
  3403.  
  3404.             As we explained, in text mode, you have 16 foreground colors
  3405.       but only 8 background colors.  Each cell on the 80x25 screen has a
  3406.       full byte describing its "attributes" so there is enough room to
  3407.       describe 16 foreground and 16 background colors but instead, by
  3408.       default, the bit that would naturally describe the intensity of
  3409.       background instead describes whether the foreground is blinking.
  3410.       One can program the EGA or VGA to suppress blinking and instead display
  3411.       the full 16 background colors.  The command
  3412.             stackey -B
  3413.       turns off the blinking choice and turns on the 16 background color
  3414.  
  3415.  
  3416.       Chapter IV:SETTING COLORS                                  page 63
  3417.  
  3418.  
  3419.  
  3420.  
  3421.                         Documentation for STACKEY, Version 4.0 
  3422.  
  3423.  
  3424.       mode while the command
  3425.             stackey +B
  3426.       turns blinking back on and reverts to the 8 background color mode.
  3427.       These commands only have an effect on text modes.  Like the L,P and
  3428.       temporary [] commands, the +/-B commands are subject to smart
  3429.       processing.
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.       Chapter IV:SETTING COLORS                                  page 64
  3471.  
  3472.  
  3473.  
  3474.  
  3475.                             Chapter V:UTILITIES MODE
  3476.  
  3477.  
  3478.       V.1 Overview of Utilities Mode
  3479.  
  3480.             STACKEY offers a command line utility mode that should allow
  3481.       you to replace lots of little utilities that you might have.  In a
  3482.       sense, these utilities are completely independent of STACKEY's key
  3483.       stacking function.  The commonality of the two modes is that they
  3484.       are both naturally callable from BATch files or from CED synonyms
  3485.       and a commonality of some parts of syntax.  However, it is possible
  3486.       to use the utilities without loading the resident portion of STACKEY
  3487.       if you wish.  STACKEY's send mode (Section II.12) is really a
  3488.       utility since it doesn't use the resident part of STACKEY; however,
  3489.       there is no way to use it without loading the resident portion.
  3490.  
  3491.             Utilities are called from the STACKEY command line by placing
  3492.       the desired function within braces {}.  As usual you can place any
  3493.       other STACKEY commands on the same line so long as the utility ends
  3494.       with }.  If there are other commands on the line or there is a
  3495.       final }, then the resident portion of STACKEY will be loaded if it
  3496.       has not been previously loaded.  However, if you meet two
  3497.       conditions, then the resident portion will NOT load: you must not
  3498.       place any commands on the line before the opening { and you must
  3499.       not put in a closing }.   By separating with delimiters (space or
  3500.       semicolon but NOT comma since a comma is used as a delimiter for
  3501.       multiple parameters in a single command) you can call up several
  3502.       utilities at once.  Thus, to switch to a color monitor and a block
  3503.       cursor covering the entire line you can use
  3504.             stackey {MON=c CUR=0,7}
  3505.       or
  3506.             stackey {MON=c CUR=0,7
  3507.       In the second case, the resident portion would not load if it were
  3508.       not already loaded whereas in the first case it would.  Placing a
  3509.       command to the stack like CR before or after the {}'s in the first
  3510.       case would have the same effect.  In the second case placing CR
  3511.       before the { would load STACKEY if it weren't already loaded.
  3512.       Placing it at the end of the line with no closing } before would
  3513.       produce an error message.
  3514.  
  3515.             It is important to realize that utilities are implemented in
  3516.       real time and in the order they occur.  Thus
  3517.             stackey {Wait=360 MON=m}
  3518.       would wait 20 seconds before changing monitors while
  3519.             stackey {MON=m WAit=360}
  3520.       would change to the monochrome screen and then wait 20 seconds
  3521.       before continuing the BATch file or returning control to DOS.
  3522.  
  3523.  
  3524.       Chapter V:UTILITIES MODE                                   Page 65
  3525.  
  3526.  
  3527.  
  3528.  
  3529.                         Documentation for STACKEY, Version 4.0 
  3530.  
  3531.  
  3532.       Because of the real time processing of utilities, errors in syntax
  3533.       are handled a little bit differently when there are utilities
  3534.       commands on the command line.  Normally, if there is any error on
  3535.       the command line, STACKEY aborts with an error message and takes no
  3536.       action.  But since a utility command is implemented as found, if an
  3537.       error occurs afterwards STACKEY will abort with an error message
  3538.       but any utilities which have been done will not be undone.  For
  3539.       example, the line
  3540.             stackey xyz {MON=m}
  3541.       will abort with an error message and no action taken but
  3542.             stackey {MON=m} xyz
  3543.       will first switch to the monochrome screen and then abort with an
  3544.       error message (naturally on the monochrome screen).
  3545.  
  3546.             Because utilities are performed in real time while commands to
  3547.       the resident part are performed only when the entire line has been
  3548.       processed for errors, commands to the resident part will normally
  3549.       only be implemented after utilities even if they proceed the
  3550.       utilities in line. Thus
  3551.             stackey [0=1]{MON=m}
  3552.       will only issue the palette change after the monitor change.  If you
  3553.       want to have the palette change before the monitor change, you
  3554.       should use separate lines:
  3555.             stackey [0=1]
  3556.             stackey {MON=m}
  3557.       A special rule applies with waits where the commands prior to a
  3558.       wait are placed in the stack before the wait.  For example
  3559.             stackey [1=4]{W=36}[1=1]
  3560.       if you normally have a blue screen will show you a red screen for 2
  3561.       seconds.
  3562.  
  3563.  
  3564.             The precise syntax for the utilities command within braces is
  3565.       either
  3566.             FUNCTION
  3567.       or
  3568.             FUNCTION=parameter(s)
  3569.       if there are some necessary parameters.  FUNCTION uses the notion
  3570.       of minimal truncation.  Thus MON is the minimal truncation for
  3571.       MONITOR so any of MON, MONI, MONIT, MONITO and MONITOR are
  3572.       acceptable where MONITOR is indicated.  We use the shortest minimal
  3573.       truncations which avoid ambiguity so MO is not a truncation for
  3574.       MONITOR to avoid confusion with the MODE command.  To indicate that MON
  3575.       is the minimal truncation, we'll write the command at the start of the
  3576.  
  3577.  
  3578.       Chapter V:UTILITIES MODE                                   Page 66
  3579.  
  3580.  
  3581.  
  3582.  
  3583.                         Documentation for STACKEY, Version 4.0 
  3584.  
  3585.  
  3586.       section describing it, and in the summary as MONitor.  In spite of this
  3587.       case, the commands are not case sensitive so {mon=m} or even {MoN=m}
  3588.       would work.
  3589.  
  3590.             You may not use any spaces before or after the = signs when
  3591.       parameters are required.  While we recommend that you do use delimiters
  3592.       between utilities, you need not so that
  3593.             stackey {MON=cw=36}
  3594.       would switch to the color monitor and wait 2 seconds.  However, if
  3595.       the command has no parameters and you use a minimal truncation, you
  3596.       must use a delimiter.  Thus
  3597.             stackey {K be=54}
  3598.       or
  3599.             stackey {Keywaitbe=54}
  3600.       will both work but
  3601.             stackey {kbe=54}
  3602.       will generate an error message.
  3603.  
  3604.             The LOCK and BEEP commands let you issue several calls at
  3605.       once by separating the parameters by colons as in
  3606.             stackey {LO=-C:-N:-S}
  3607.       In addition you can call several beeps at once by using
  3608.       colons.
  3609.  
  3610.             A summary of all the commands can be found at the end of the
  3611.       documentation and in the help available from the DOS command line.
  3612.  
  3613.  
  3614.       V.2 WAITs and UNTILs
  3615.  
  3616.             Commands:Wait=nnn, UNtil=HH:MM (followed by p,t,n)
  3617.  
  3618.             There are times when you want to pause in your BATch files to
  3619.       give the user a chance to read a screen or because the action you
  3620.       want is time sensitive.  The WAIT utility command is precisely for
  3621.       such times.  The minimal truncation is W so the syntax is
  3622.             stackey {W=nnn}
  3623.       where nnn is the number of ticks for the delay.  There are roughly
  3624.       18 ticks per second and about 64K ticks per hour.  nnn must lie
  3625.       between 1 and 64K=65,535.  If a larger number is used you get an
  3626.       error message "Number out of range".
  3627.  
  3628.             If you want a delay longer than 60 minutes, you can place
  3629.       multiple waits as in
  3630.  
  3631.  
  3632.       Chapter V:UTILITIES MODE                                   Page 67
  3633.  
  3634.  
  3635.  
  3636.  
  3637.                         Documentation for STACKEY, Version 4.0 
  3638.  
  3639.  
  3640.             stackey {W=64000 W=64000}
  3641.  
  3642.             Often, instead of wanting to wait for a fixed time, you want to
  3643.       wait until a fixed time.  That is, you want to hold up a pending batch
  3644.       file until a time comes.  The UNTIL command will do this.  In its
  3645.       simplest form the syntax is
  3646.             stackey {UNtil=HH:MM}
  3647.       where HH:MM is a military (24 hour clock).  However, STACKEY will
  3648.       recognize three letters after the HH:MM.  First, a "p" will add 12
  3649.       hours so that {until=3:15p} will be interpreted as 15:15, i.e. 3:15
  3650.       pm.  p must be the first letter after HH:MM.  t for (tomorrow) will
  3651.       add 24 hours; multiple t's are allowed as is pt (but not tp).  Thus
  3652.       {until=3:15pttt} would wait until 3:15 in the afternoon, three full
  3653.       days after the current day.
  3654.  
  3655.             STACKEY does not check that the time is a legal time so that
  3656.       {UNtil=32:15} would be interpreted as 8:15 tomorrow as would
  3657.       {UNtil= 30:135}.
  3658.  
  3659.             Normally STACKEY computes the time that you are calling for and
  3660.       checks if that time has past.  If it has, STACKEY assumes that you've
  3661.       made a mistake and exits with an error message.  For example, if you
  3662.       enter
  3663.            STACKEY {UNtil=3:15p}
  3664.       and it s 4:00 pm, you'll get an error message.  Of course, it may
  3665.       happen that you'll want something to happen the next 3am whether it
  3666.       is today or tomorrow.  Suppose, for example that you leave your
  3667.       machine on 24 hours a day but some resident program insists on
  3668.       reading daily alarms each day.  So you might want to reboot at 3AM
  3669.       while you sleep.  A batch file
  3670.             stackey {UNtil=3:00}{reboot}
  3671.       will do what you want so long as you start it after midnight but if you
  3672.       start it before, you'll get an error message.  The key letter n
  3673.       tells STACKEY you want the next time that time appears.
  3674.       Explicitly, it computes the time and, if it has past adds 24 hours.
  3675.       Thus
  3676.             stackey {UNtil=3:00n}{reboot}
  3677.       will do what is desired.  {until=HH:MMntt} will not wait two days after
  3678.       the next HH:MM.  Instead use two separate stackey commands if that
  3679.       is what you want, e.g.
  3680.             stackey {UNtil=3:00n}{UNtil=3:00tt}
  3681.       if you want to wait until two days after the next 3:00 am.
  3682.  
  3683.  
  3684.  
  3685.  
  3686.       Chapter V:UTILITIES MODE                                   Page 68
  3687.  
  3688.  
  3689.  
  3690.  
  3691.                         Documentation for STACKEY, Version 4.0 
  3692.  
  3693.  
  3694.             If you put in a wait or until by mistake, hitting Ctrl-
  3695.       Break, ^C or <Esc> at the keyboard will cancel the wait; i.e.
  3696.       STACKEY will exit.  The remainder of the STACKEY command line will
  3697.       also be cancelled.
  3698.  
  3699.             You should distinguish between what we call delays and what
  3700.       we call waits.  Delays are set with the command Wnnn while waits
  3701.       are set with the {WAIT=nnn} utilities mode command.  Delays are
  3702.       commands to the resident part of STACKEY telling it to delay
  3703.       placing strokes in BIOS' buffer (or setting colors) while operating
  3704.       in the background as some foreground program is running.  Waits are
  3705.       commands to the foreground part of STACKEY telling it to loop and
  3706.       control all machine resources (although you can call up a program
  3707.       like SIDEKICK) until the wait period is over.  Thus waits will be
  3708.       useful only in rather special circumstances like demonstration
  3709.       BATch files while delays will get used more often.
  3710.  
  3711.             Similarly, you need to distinguish between the {UNTIL=..}
  3712.       utility and the resident UN command.  UN is the analog to Wnnn while
  3713.       {UNTIL} is the analog of {WAIT}.
  3714.  
  3715.             Delays are implemented as they are reached by the resident
  3716.       part of STACKEY.  Thus, if you send more strokes to STACKEY's
  3717.       buffer than there is room for in BIOS' buffer, STACKEY will pause in
  3718.       sending its buffer until the backlog of strokes in BIOS's buffer is
  3719.       cleared.  If there is a delay in the "strokes" waiting for STACKEY
  3720.       to process, the count in the delay will not begin until the delay
  3721.       is reached in STACKEY's buffer.  In distinction to this, STACKEY
  3722.       implements waits as soon as they are reached in its interpretation
  3723.       of the command line.
  3724.  
  3725.             As already noted, while STACKEY loops and counts time when
  3726.       involved in a wait, you can invoke a resident program like
  3727.       SIDEKICK(TM) at such a time.  STACKEY will continue to count time
  3728.       while the resident program is active and if the wait ends while the
  3729.       resident program is up, then STACKEY will exit as soon it regains
  3730.       control.
  3731.  
  3732.             WAITs are computed by using the built in real time clock on
  3733.       the PC and so should be independent of hardware so long as the IBM
  3734.       standard 55 millisecond tick rate is used.  In particular, they
  3735.       will work the same way on 4.77 MHz PC's, 6 MHz AT's, 12 MHz AT
  3736.       clones and 25 MHz Northgate 386 machines.  Other wait programs like
  3737.       the public domain WAITN.COM just program loops and will run for
  3738.  
  3739.  
  3740.       Chapter V:UTILITIES MODE                                   Page 69
  3741.  
  3742.  
  3743.  
  3744.  
  3745.                         Documentation for STACKEY, Version 4.0 
  3746.  
  3747.  
  3748.       shorter times on machines with higher crystal speeds.
  3749.  
  3750.  
  3751.  
  3752.       V.3 Switching Monitors and Ports
  3753.  
  3754.             Commands:MONitor=x (x=C,M,S), Prn, COmm
  3755.  
  3756.             There are utilities to switch ports and monitors.  The command
  3757.                stackey {PRN}
  3758.       will interchange LPT1 and LPT2 so that what was previously attached
  3759.       to LPT2 will now respond to attempts to send things out LPT1 and
  3760.       vice versa.  Repeating the command will interchange them again
  3761.       restoring the status quo ante.  Similarly, {COMM} will interchange
  3762.       COM1 and COM2.  The minimal truncation for PRN is P and for COMM is
  3763.       CO.  If you are not adding the final }, you will need to use
  3764.       the full PRN or COMM if they are the last command on the
  3765.       line.  CTRLALT PLUS includes a resident program called 2ND PRINTER
  3766.       which will let you change printers from within a running program.
  3767.  
  3768.             Similarly, you can switch monitors with the MONITOR utility
  3769.       command whose minimal truncation is MON.  This however must take a
  3770.       parameter.  To switch monitors use MON=S, to force the color monitor
  3771.       use MON=C and to force the monochrome monitor use MON=M.
  3772.  
  3773.             You will also wind up on the target monitor in 80 column text
  3774.       mode after a MON command.  In addition, the cursor on the original
  3775.       monitor, if different from the target, will be removed.  Be careful
  3776.       not to use the MON command if you only have one monitor.
  3777.  
  3778.             CTRLALT PLUS, another program by the authors of STACKEY
  3779.       provides considerable support for systems with two monitors and/or
  3780.       two printers.
  3781.  
  3782.  
  3783.       V.4 Turning off PrintScreen
  3784.  
  3785.             Nothing can be quite as frustrating as hitting Shift-PrintScreen
  3786.       by mistake with a computer not attached to a printer!  Typically you'll
  3787.       hang losing any unsaved work.   For such purposes, STACKEY provides a
  3788.       two key code P- which turns off the ability of Shift-PrintScreen to
  3789.       work.  You do this with
  3790.             stackey P-
  3791.       so that it is not a utility but rather a resident command.  However,
  3792.  
  3793.  
  3794.       Chapter V:UTILITIES MODE                                   Page 70
  3795.  
  3796.  
  3797.  
  3798.  
  3799.                         Documentation for STACKEY, Version 4.0 
  3800.  
  3801.  
  3802.       like the Z+/Z- speedup commands described in Section II.6, it acts much
  3803.       like a utility.  To turn the ability of Shift-PrintScrren to work
  3804.       again, use P+.
  3805.  
  3806.             This command works by turning on the byte in the BIOS data area
  3807.       that says a print screen is in process.  So, if you hit Shift-
  3808.       PrintScreen, the BIOS check that sees if there is already a print
  3809.       screen in progress, thinks there is and it exits.  This means that P-
  3810.       will not effect other programs like PIZAZZ PLUS or FRIEZE that pop up
  3811.       on the Shift-PrintScreen combination.
  3812.  
  3813.  
  3814.       V.5 Mode, Lines and Cursor Control
  3815.  
  3816.             Commands: MODe=n, UMode=n
  3817.                       LInes=25, 43 or 50
  3818.                       CUrsor=+ or -, CUrsor=n,m
  3819.  
  3820.             There are a number of utilities commands associated with the
  3821.       video display.  You will not normally want to switch modes when at
  3822.       the DOS level but might, for example, to check out color setting
  3823.       commands discussed in the last chapter.  The MODE=n command will
  3824.       switch to mode n if n is on the allowed table below.  If a not
  3825.       allowed value is used, STACKEY will abort with a syntax error
  3826.       message.  Allowed values of n are:
  3827.             On an ordinary (or Hercules) monochrome screen: 7
  3828.             On an EGA attached to a monochrome monitor: 7,15
  3829.             On a CGA: 1,3,4,6
  3830.             On an EGA attached to a color monitor: 1,3,4,6,13,14,16
  3831.             On a VGA: 1,3,4,6,13,14,16,17,18,19
  3832.       With one exception, this prevents you from trying to switch to an
  3833.       illegal mode which may produce problems.  The exception is that you
  3834.       should not try to switch to mode 16 if you have an EGA connected to
  3835.       the old fashioned color display rather than an enhanced color
  3836.       display.  For example
  3837.             stackey {mod=14}
  3838.       will switch to the medium resolution EGA 14 color graphics mode if
  3839.       issued on a color screen and if you have an EGA.  The minimal
  3840.       truncation for MODE is MOD.
  3841.  
  3842.             Some Super VGA monitors have additional modes set with a BIOS
  3843.       call identical to the standard mode change but with another mode
  3844.       number.  If you wish STACKEY to make such a call without checking that
  3845.       the mode number is legal, use the UMODE command (for User mode).
  3846.  
  3847.  
  3848.       Chapter V:UTILITIES MODE                                   Page 71
  3849.  
  3850.  
  3851.  
  3852.  
  3853.                         Documentation for STACKEY, Version 4.0 
  3854.  
  3855.  
  3856.             LINES=25 and LINES=43 will switch to the appropriate modes if
  3857.       you have an EGA.  Many programs will not act properly in 43 line
  3858.       mode.  The minimal truncation is LI.  On a VGA, use LINES=25 or
  3859.       LINES=50 instead.  STACKEY will check on the monitor type and issue
  3860.       an error message if you use any value of lines other than 25, 43 or
  3861.       50 and if you use an illegal value for the monitor you have (e.g.
  3862.       lines=43 on a VGA).
  3863.  
  3864.             CURSOR, which takes one or two parameters, controls the
  3865.       cursor.  The minimal truncation is CU.  CU=- will remove the cursor
  3866.       and CU=+ will restore it to the standard place (lines 6 and 7 on
  3867.       the color monitor and lines 12 and 13 on the monochrome monitor).
  3868.       For certain BATch file displays, it is effective to use CU=- but
  3869.       please remember to restore the cursor with CU=+.  If you don't like
  3870.       the standard cursor you can control it with CU=m,n.  On a color
  3871.       monitor, there are 8 lines, labelled 0 through 7 and on a
  3872.       monochrome monitor 14 lines labelled 0 through 13.  The command
  3873.       CU=m,n when m and n are in the allowed values sets the cursor to
  3874.       start on line m and end on line n.  If m is less than or equal to
  3875.       n, the cursor is in one piece while if m is greater than n, the
  3876.       cursor wraps around an is in two pieces.  For example
  3877.             stackey {cu=0,7}
  3878.       produces a full height block cursor on a color monitor and
  3879.             stackey {cu=7,0}
  3880.       produces a cursor consisting of a thin roof and thin ceiling.
  3881.  
  3882.             Using improper values will typically produce unexpected
  3883.       effects, e.g. {cu=32,0} will cause the cursor to vanish (and is
  3884.       effectively the same as cu=-).
  3885.  
  3886.             Programs like CED and FANSI CONSOLE can effect the cursor at
  3887.       the DOS prompt.  In particular, on a machine with SOFTWARE CAROUSEL
  3888.       and FANSI CONSOLE, partitions with PCED had any cursor set with
  3889.       STACKEY immediately reset at the DOS level.  But in BATch files,
  3890.       STACKEY should give you complete control over the cursor.
  3891.  
  3892.             BATUTIL will let you change the position of the cursor; see
  3893.       the BATUTIL documentation for the ROw and COl commands.
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.       Chapter V:UTILITIES MODE                                   Page 72
  3903.  
  3904.  
  3905.  
  3906.  
  3907.                         Documentation for STACKEY, Version 4.0 
  3908.  
  3909.  
  3910.       V.6 Beeps
  3911.  
  3912.             Command: BEep=n,m or BEep=n
  3913.  
  3914.             You can send variable length and frequency beeps with
  3915.       STACKEY.  In version 2.0 of STACKEY, the duration for a given set of
  3916.       parameters was machine dependent since it relied on the clock speed
  3917.       of the underlying machine although the frequency was machine
  3918.       independent.  BEEP, whose minimal truncation is BE takes two
  3919.       parameters.  The second parameter may be left blank in which case
  3920.       the comma must also be left out.  The first parameter determines
  3921.       the frequency and n is a measure of the inverse frequency so as n
  3922.       increases the pitch goes down.  The most reasonable values are n
  3923.       between 15 and 60 but any number between 1 and 256 will yield an
  3924.       audible sound.  The second number is the duration; the default is
  3925.       m=50.  You'll have to play with this one to see how it works.  The
  3926.       sample BATch file SOUNDS.BAT is not intended as competition for
  3927.       Pianoman.
  3928.  
  3929.             Multiple beeps can be stacked as in
  3930.             stackey {BE=20,40:75,55}
  3931.       In addition, you can tell STACKEY to repeat a string of beeps
  3932.       multiple times by inserting "#nnn" between "BE" and "=".  For
  3933.       example,
  3934.             stackey {BE#5=20,80:30,90:40,80}
  3935.       would play the three notes and then repeat it four more times.
  3936.  
  3937.  
  3938.       V.7 Screen dumps
  3939.  
  3940.             Commands: DUMPP, DUMPF=x,DUMPOF=x,DUMPL=x,DUMPOL=x
  3941.                  where x is a filespec
  3942.  
  3943.             STACKEY will let you send the current screen to the printer
  3944.       or a file.  The command line
  3945.             stackey {dumpp}
  3946.       will send the screen to the printer.  If the printer is not on or
  3947.       you have no printer, a standard STACKEY error message will display.
  3948.       This command simulates the pressing of <Shift-PrtSc> so if you have
  3949.       a program like Intel's QUIKBUF or Zsoft's FRIEZE which takes over
  3950.       this key combination, it will be called up instead of the screen
  3951.       printing.
  3952.  
  3953.  
  3954.  
  3955.  
  3956.       Chapter V:UTILITIES MODE                                   Page 73
  3957.  
  3958.  
  3959.  
  3960.  
  3961.                         Documentation for STACKEY, Version 4.0 
  3962.  
  3963.  
  3964.             DUMPF, DUMPOF, DUMPL and DUMPOL which require an = and a file
  3965.       name, all dump the screen to a file.  The commands without an "O"
  3966.       append the present screen to the file if it exists while those with
  3967.       an "O" will overwrite it.  The commands with an F make the 2000
  3968.       bytes on the screen into a file.  This file will occur as one long
  3969.       line with no LF/CR pairs.  Those with an L append LF/CR pairs at
  3970.       the end of each line and so produce files with 2050 bytes.  Files
  3971.       produced with an L will be properly displayed in a file viewer like
  3972.       Vern Beurg's LIST while those produced by an F will properly TYPE
  3973.       to the screen.  If you TYPE a file with L to the screen, blank
  3974.       lines will appear in between each original line.  LIST can properly
  3975.       view files made with F if you turn wrap on but many other programs
  3976.       will have problems with files produced in that manner.
  3977.  
  3978.             The filespec placed after = is passed to DOS so the usual
  3979.       rules apply.  If there is any kind of file error whether due to an
  3980.       invalid path or an open drive door, STACKEY will exit with the
  3981.       message
  3982.             STACKEY: DOS File Error
  3983.       and set the errorlevel to 3.
  3984.  
  3985.  
  3986.       V.8 Rebooting
  3987.  
  3988.             Commands: BOOT(=c), REBOOT(=c)
  3989.             Minimal truncation NONE
  3990.  
  3991.             In rare circumstances you may want to reboot your machine
  3992.       automatically.  STACKEY only accepts the exact phrase BOOT or
  3993.       REBOOT and if it finds it looks for the next two characters.  If
  3994.       they are "=c", STACKEY initiates a cold reboot, otherwise a warm
  3995.       reboot.  The difference is the parity resetting and checking of
  3996.       memory.  While the reboot method just jumps to the instruction in
  3997.       ROM that is gone to when you turn on the machine, if you try to
  3998.       REBOOT with STACKEY and you are using SOFTWARE CAROUSEL your EMS
  3999.       board may not reset properly; a second warm reboot should clear
  4000.       that up.
  4001.  
  4002.       V.9 Lock Toggles
  4003.  
  4004.             Command: LOck=xy   (with x=+ or -; y=C,S,N,I)
  4005.  
  4006.             For consistency, recognizing that the lock commands like +C
  4007.       are real time utilities, the eight two character commands
  4008.  
  4009.  
  4010.       Chapter V:UTILITIES MODE                                   Page 74
  4011.  
  4012.  
  4013.  
  4014.  
  4015.                         Documentation for STACKEY, Version 4.0 
  4016.  
  4017.  
  4018.       +/- C,S,N,I are available in utilities mode as {LOCK=xy}.  So to
  4019.       turn on the caps lock you could use
  4020.             stackey {LOCK=+C}
  4021.       or
  4022.             stackey +C
  4023.       The only reason to prefer the former is if you do not want STACKEY
  4024.       resident and leave off the final }.  The minimal truncation is LO.
  4025.  
  4026.             Multiple lock commands can be combined separated by colons as
  4027.       in
  4028.             stackey {lo=-C:-N:-S}
  4029.  
  4030.  
  4031.       V.10 The Halt Command
  4032.  
  4033.       Command:HAlt
  4034.             STACKEY offers a command which halts a batch file in
  4035.       midstream.  You'd use it most often after an if command as in
  4036.             if errorlevel 2 then STACKEY {HA}
  4037.       The HALT command first checks if Break is on and if it is not, it
  4038.       turns it on.  Then it places a ^C in the buffer so that DOS will
  4039.       pause the batch file and display the message:
  4040.             Terminate batch job (Y/N)?
  4041.       and give you an opportunity to terminate the batch file.  If you
  4042.       wish to absolutely terminate the batch file without a Y/N question
  4043.       from DOS, make the last line of the batch file the label :end and
  4044.       use
  4045.             if errorlevel 2 then goto end
  4046.  
  4047.             If STACKEY finds the Break is off and turns it on, it
  4048.       displays the message:
  4049.             STACKEY: BREAK has been turned on.
  4050.  
  4051.  
  4052.       V.11 Pause for input
  4053.  
  4054.       Commands:Keywait, Enterwait, Abortwait, ~abortwait
  4055.             STACKEY 2.0 had four commands to interact with keyboard input
  4056.       in batch files.  For compatibility, these are still included
  4057.       although BATUTIL has expanded and extended them.
  4058.             KEYWAIT will pause a batch file for a key to be hit.  It is
  4059.       equivalent to
  4060.             BATUTIL {GE el}
  4061.       while ENTERWAIT, which pauses until <Enter> is hit is equivalent to
  4062.  
  4063.  
  4064.       Chapter V:UTILITIES MODE                                   Page 75
  4065.  
  4066.  
  4067.  
  4068.  
  4069.                         Documentation for STACKEY, Version 4.0 
  4070.  
  4071.  
  4072.             BATUTIL {GE cr}
  4073.  
  4074.             ABORTWAIT pauses until either Y or N is pressed and halts the
  4075.       batch file if Y is pressed.  It is equivalent to
  4076.             BATUTIL {ge Y N}
  4077.             if not errorlevel 2 then stackey {HA}
  4078.  
  4079.             ~ABORTWAIT pauses until either Y or N is pressed and
  4080.       halts the batch file if N is pressed.  It is equivalent to
  4081.             BATUTIL {ge N Y}
  4082.             if not errorlevel 2 then stackey {HA}
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.       Chapter V:UTILITIES MODE                                   Page 76
  4119.  
  4120.  
  4121.  
  4122.  
  4123.                              Chapter VI:ADVANCED TOPICS
  4124.  
  4125.  
  4126.           In this chapter, we discuss three distinct advanced topics.  First,
  4127.       for the reader's background, we provide a tutorial on how keystrokes
  4128.       are processed in a PC.  This may help you understand what STACKEY can
  4129.       and cannot do but for most operations that you'd want to do, it isn't
  4130.       necessary.  Then we'll discuss a powerful but potentially VERY
  4131.       DANGEROUS feature where STACKEY allows you to place any arbitrary
  4132.       sequence of machine language instructions in the middle of a STACKEY
  4133.       script.  We originally developed this INLINE feature for STACKEY's
  4134.       internal purposes.  The idea was that while we wanted to give users of
  4135.       a program like CAROUSEL access to the Qn command, it hardly seemed fair
  4136.       to make all users carry the code for that command as part of the
  4137.       RESIDENT code of STACKEY.  We thus developed INLINE code to place a
  4138.       sequence of commands as part of the playback buffer.  Thus the Carousel
  4139.       code is part of the non-resident program and is only loaded into the
  4140.       keystroke buffer when needed.  Of course, if you have long scripts that
  4141.       include INLINE commands, you'll need to increase your buffer size but
  4142.       this need will only be felt by a small set of users.  INLINE code if
  4143.       not done right can really screwup your machine - requiring a reboot or
  4144.       even lost disk data.  It should only be used by those who know what
  4145.       they are doing which means people adept in 80x86 assembly language.  If
  4146.       you are copying an inline routine supplied by someone else, be careful
  4147.       to not make any typing errors!  There is also an EXTERNAL command to
  4148.       read inline code from a binary file.  As illustrations, we have
  4149.       supplied a number of external files called *.bin.
  4150.             Finally, we will describe STACKEY's API (application program
  4151.       interface) which programs can use to talk to the resident part of
  4152.       STACKEY.  Indeed, STACKEY's nonresident part talks to the resident part
  4153.       through the API.
  4154.  
  4155.  
  4156.       VI.1 Keyboard basics: interrupts
  4157.  
  4158.             We want to explain the journey taken by a single keystroke.
  4159.       In short, hitting a key calls int 9 and the BIOS processes the
  4160.       keystroke and places it in a buffer.  Programs then call BIOS int 16
  4161.       or DOS service 8 to get keystrokes out of the buffer.  Here is more
  4162.       detail:
  4163.             Your CPU runs programs as a sequence of instructions in RAM.
  4164.       RAM is organized into bytes, each of which has a unique address.
  4165.       Normally, the CPU runs a program by sequentially going through the
  4166.       instructions but there are instructions to jump to a given address
  4167.       or to jump depending on the result of some comparison.  Programs
  4168.       call DOS services by placing certain information in the CPU
  4169.       registers (local storage in the CPU) which tell DOS what is wanted
  4170.  
  4171.  
  4172.       Chapter VI:ADVANCED TOPICS                                 Page 77
  4173.  
  4174.  
  4175.  
  4176.  
  4177.                         Documentation for STACKEY, Version 4.0 
  4178.  
  4179.  
  4180.       and then turn control over to DOS.  How does the program know where
  4181.       DOS is since different versions of DOS will typically reside in
  4182.       different places?  The lowest 1K of bytes on the machine is a list
  4183.       of 256 addresses.  The instruction int nn (with nn a Hex number)
  4184.       transfers control to address nn of these 256 (with the convention
  4185.       that the first address is int 0 so int 21, the interrupt for most
  4186.       DOS services is the 34th address since 21H = 33).  This is done in
  4187.       a way that stores the current state of the machine so that if DOS
  4188.       ends its routine with an IRET (interrupt return) instruction, then
  4189.       the calling program can resume operation from where it began.
  4190.  
  4191.             What has just been described is a software interrupt, that is
  4192.       one that is called by a program actively asking for that interrupt.
  4193.       There are also hardware interrupts, indeed the notion began with
  4194.       hardware interrupts.  How does the CPU determine that a key has
  4195.       been struck?  It could periodically ask the keyboard: "Hey, any
  4196.       action for me?" but such "polling" isn't very efficient.  A better
  4197.       method is for the keyboard to tap the CPU on shoulder and say:
  4198.       "I've got something for you, buddy".  What the CPU should do is
  4199.       stop what it is doing, keep a record of where it is, process the
  4200.       stroke and return to what it is doing.  In more prosaic terms,
  4201.       hitting a key sends a signal to the interrupt controller chip which
  4202.       causes int 9 to be issued.  This transfers control to the 10th
  4203.       address in memory, information is processed on the basis of which
  4204.       key is struck and control is then returned to where the CPU was and
  4205.       the underlying program continues.
  4206.  
  4207.             The two hardware interrupts of greatest interest are int 9
  4208.       which is issued whenever a key is hit or released and int 8, the
  4209.       timer interrupt which is issued every 55 milliseconds.  These 55
  4210.       millisecond periods are called clock ticks.  There are roughly 18.2
  4211.       per second.
  4212.  
  4213.             One of the key aspects of interrupts is that a program can
  4214.       steal an interrupt.  If done responsibly, such larceny is good for
  4215.       everyone and in particular TSRs can only work because they steal
  4216.       interrupts.  Let's imagine a program that pops up whenever you hit
  4217.       Ctrl+Alt+A.  How does such a program gain control when you hit its
  4218.       hotkey?  When it loads, it looks at the address stored for int 9.
  4219.       This is the address of the routine which will be called whenever a
  4220.       key is struck.  It stores this address in its own data area and
  4221.       places the address of some of its code in the int 9 location.  Thus
  4222.       one of its routines is called whenever a key is struck.  This
  4223.       routine will look and see if the key hit was A; if it is A, then it
  4224.  
  4225.  
  4226.       Chapter VI:ADVANCED TOPICS                                 Page 78
  4227.  
  4228.  
  4229.  
  4230.  
  4231.                         Documentation for STACKEY, Version 4.0 
  4232.  
  4233.  
  4234.       checks the byte where BIOS keeps the state of the shift keys and
  4235.       checks if Ctrl+Alt are depressed.  If they are, then the TSR pops
  4236.       up after doing some necessary housekeeping to reset the keyboard
  4237.       and interrupt controller.  If the key isn't for the TSR program,
  4238.       then the routine passes control to the original routine stored at
  4239.       the original int 9 address.  In this way, a chain is created of all
  4240.       the different TSRs peeking at each keystroke and passing it on if
  4241.       it isn't their hotkey.  TSR technology is more complex than this
  4242.       but this describes the basic idea.  It is only by sitting on some
  4243.       interrupt that a program can get control and so take part in the
  4244.       goings on.  STACKEY actually does most of its work by sitting on
  4245.       the timer interrupt, checking each 55 milliseconds to see if it
  4246.       still has anything to do.
  4247.  
  4248.  
  4249.       VI.2 Keyboard basics: The buffer and BIOS data area
  4250.  
  4251.             The first 1024 bytes in memory contain the interrupt table.
  4252.       The next 256 bytes form the "BIOS data area" where lots of
  4253.       miscellaneous information is kept including the number of clock
  4254.       ticks since midnight (BIOS sits on int 8 and increases this number
  4255.       every time int 8 is called) and a good deal of information about the
  4256.       keyboard.  In one byte is kept the information about the state of
  4257.       CapsLock, NumLock, ScrollLock and the Insert state.  As part of the
  4258.       same byte is kept information about which of the four shift keys is
  4259.       currently depressed (thus all 8 bits of this byte are productively
  4260.       used).
  4261.  
  4262.             34 bytes are used to deal with a type ahead buffer.  As
  4263.       we'll explain, each "normal" keystroke places two bytes in the
  4264.       buffer.  As you type, new two byte combinations are added to the
  4265.       buffer while as an application processes input, two byte
  4266.       combinations are "removed from the buffer".  Rather than actually
  4267.       remove the bytes, BIOS keeps track of the head of the active buffer
  4268.       and of its tail.  The head is the address of the next stroke to be
  4269.       processed and when it is processed all that BIOS does is move the
  4270.       head pointer up in memory.  As you hit keystrokes, they are placed
  4271.       in the buffer at the position kept by the tail pointer and it is
  4272.       moved up.  The 15 word (a word means two bytes) buffer is circular
  4273.       so that the head and tail pointers will wrap around the circle.  If
  4274.       the head has caught up to the tail, then BIOS knows that the buffer
  4275.       is empty and will so inform a program that asks.  If the tail has
  4276.       looped around and caught up with the head, BIOS knows that the type
  4277.       ahead buffer is full and will beep at you if you try to type more.
  4278.  
  4279.  
  4280.       Chapter VI:ADVANCED TOPICS                                 Page 79
  4281.  
  4282.  
  4283.  
  4284.  
  4285.                         Documentation for STACKEY, Version 4.0 
  4286.  
  4287.  
  4288.       VI.3 Keyboard basics: Int 9 processing
  4289.  
  4290.             The keyboard on the original PC has its own built in micro
  4291.       processor but it is not a very clever one.  Basically, all it knows
  4292.       about is that you have depressed or released a certain key.  To it
  4293.       all keys have equal footing - it doesn't distinguish between
  4294.       shifts, locks or letter keys.  It just knows them as keys.  Each
  4295.       key has its own unique hardware scan code so that the <Esc> key has
  4296.       scan code 01, the letter "A" scan code 1EH, <F7> 41H, the Left
  4297.       shift 2AH and the Capslock 3AH. Basically, the codes are arranged
  4298.       so that on the original PC they increased from left to right in
  4299.       each row but as the position of keys migrated from one keyboard
  4300.       upgrade to the next, the old codes were kept for compatibility.
  4301.       All the codes lie between 01H and 7FH (=127).  In fact none is as
  4302.       high as 7FH but theoretically one could have 127 keys on the
  4303.       keyboard without drastic changes, but 128 or more keys each
  4304.       distinguished from the other would require a completely redesigned
  4305.       BIOS! In fact the so called enhanced keyboard is more clever.  It
  4306.       distinguishes keys like the arrow keys on the numberpad and the
  4307.       separate cursor keys pads by using a pair of codes for the arrow
  4308.       key so that in theory it could support more than 127 keys.  In
  4309.       addition, the scan codes issued by the arrow keys are dependent on
  4310.       the state of NumLock.  We will not consider the extra complications
  4311.       associated with this new keyboard again.
  4312.  
  4313.             When you hit or release a key, the microprocessor on board the
  4314.       keyboard sends a signal into the computer that activates the
  4315.       interrupt controller chip which calls int 9 in the CPU.  The CPU
  4316.       then shifts into the built in BIOS routine.  Actually, there are
  4317.       probably several onlooker TSRs that first look at each keystroke
  4318.       but let's ignore them for the time being.  The first thing that the
  4319.       BIOS does is to read the keyboard "port" for the keyboard is primed
  4320.       to report the scan code of the key hit if a key was hit or 80H plus
  4321.       the scan code if a key was released.  The keyboard will report this
  4322.       information whenever asked until it is reset which is done at the
  4323.       end of the keyboard routine.
  4324.  
  4325.             What the BIOS now does, depends on the key hit or released.
  4326.       If the capslock was the key hit, it will toggle the bit that keeps
  4327.       the capslock state; if a shift was hit, it will adjust that bit and
  4328.       if the shift was released it will adjust the bit back.  If a letter
  4329.       key was hit say "A", it will check whether there is room in the
  4330.       buffer for another keystroke and beep if there isn't.  If there is,
  4331.       it will proceed to place two bytes in the buffer.  The first byte is
  4332.  
  4333.  
  4334.       Chapter VI:ADVANCED TOPICS                                 Page 80
  4335.  
  4336.  
  4337.  
  4338.  
  4339.                         Documentation for STACKEY, Version 4.0 
  4340.  
  4341.  
  4342.       the "scan code" which is usually but not always the actual hardware
  4343.       scan code.  The second byte is the ASCII code.  For the "A" key, it
  4344.       will place the actual hardware scan code 1EH as the scan code.  To
  4345.       figure out the ASCII part, it will look at the state of the shift
  4346.       keys and of Capslock.  If "a" is intended, it will place ASCII code
  4347.       61H, if "A" then 41H, if ^A then 01H and if Alt-A then 00H.  This is
  4348.       typical: if there is no ASCII code associated to the key (Ctrl-A is
  4349.       a perfectly good ASCII character but Alt-A is not), then an ASCII
  4350.       code of 00H is placed.  In that case, the "scan code" is called
  4351.       "extended ASCII code" or "second ASCII code" - both terrible names
  4352.       since it has nothing to do with the ASCII scheme.
  4353.  
  4354.             The hardware scan code for <F1> is 3BH.  Since none of the
  4355.       shifted F1 keys has an ASCII equivalent, BIOS places an ASCII code
  4356.       of 00H in as part of the word placed in the buffer for those
  4357.       keystrokes.  If it always put the actual hardware scan code of 3BH
  4358.       into that half of the word, the computer wouldn't be able to
  4359.       distinguish F1, Shift-F1, Alt-F1 and Ctrl-F1.  So what does BIOS do?
  4360.       It makes up "scan codes" as follows (!):
  4361.             F1          3BH
  4362.             S1          54H
  4363.             A1          68H
  4364.             C1          5EH
  4365.       These codes were picked for the original PC where there were 84 keys
  4366.       with codes from 00H to 53H.  Thus 54H wasn't a real scan code but on
  4367.       an AT, it is the scan code for the <SysReq> key!  It doesn't matter
  4368.       since the SysReq key doesn't put anything in the buffer.  The "scan
  4369.       code" for Ctrl-PgUp is 84H which is the hardware scan code issued
  4370.       when you RELEASE the top row <3> key.  The point is that the "scan
  4371.       code" half of the what is put in the buffer is usually but not
  4372.       always the hardware scan code.
  4373.  
  4374.             If the key struck is on the keypad, there are extra
  4375.       complications, not only because of the numlock but because of the
  4376.       special meaning of the Alt-numeric keypad.  We won't discuss the
  4377.       details of how that is handled but once you indicate that you want
  4378.       to put in an ASCII 200 say (lower left handle double corner), it is
  4379.       put in with a "scan code" of zero.  That is if the scan code is
  4380.       zero, that indicates something put in via the keypad.  So the <+>
  4381.       (ASCII code 2BH) can normally get put in the buffer with one of 3
  4382.       different "scan codes" - 00H if you use the Alt-keypad and press <4>
  4383.       and then <3> with alt depressed, 0DH if you use the top row and 4EH
  4384.       if you use the grey plus.  Since both halves of the word are in the
  4385.       buffer, programs can distinguish between the two pluses if they
  4386.  
  4387.  
  4388.       Chapter VI:ADVANCED TOPICS                                 Page 81
  4389.  
  4390.  
  4391.  
  4392.  
  4393.                         Documentation for STACKEY, Version 4.0 
  4394.  
  4395.  
  4396.       wish.
  4397.  
  4398.             We have not discussed how typematic fits into all this
  4399.       (typematic is the name for the key repeat function that goes into
  4400.       effect when you hold a key down).  Given that int 9 tells BIOS when
  4401.       a key is released as well as hit, you can imagine how BIOS by
  4402.       combining int 9 and the timer interrupt can produce this effect.
  4403.  
  4404.             There is an important point to be made here.  Certain special
  4405.       combinations cause the BIOS to jump to special routines.  For
  4406.       example, if you hit <Del>, the BIOS checks to see if Ctrl+Alt are
  4407.       down and if so it jumps to a special routine with which you might be
  4408.       familiar.  First, it is quite possible for a program to intercept
  4409.       int 9 and disable Ctrl-Alt-Del!  Secondly, STACKEY can only mimic a
  4410.       Ctrl-Alt-Del, because we know exactly what the machine does when
  4411.       you press Ctrl-Alt-Del.  Perhaps, your clone is set up to play the
  4412.       star spangled banner when you hit Ctrl+Alt+$.  Unless we know what
  4413.       action it is taking, there is no way we can mimic that.  We do try
  4414.       to mimic the Ctrl+Alt+G+/- speed switch since there is a standard
  4415.       routine that many clones use to change the speed but if your clone
  4416.       uses something else, there is nothing that we can do mimic that!
  4417.       Why not just simulate hitting G+ with Ctrl+Alt depressed.  The
  4418.       problem is that while we can place strokes in the buffer, steal
  4419.       ints or set off custom routines, there is no way (at least no way
  4420.       known to us!) to steal the keyboard port and simulate the hitting
  4421.       of as key under int 9.
  4422.  
  4423.       VI.4 Keyboard basics: int 16/DOS service 8
  4424.  
  4425.             Int 9 places strokes in the buffer.  Application programs
  4426.       normally get the strokes out with int 16H (henceforth we'll drop
  4427.       the H from that) or by using DOS service 8 which actually calls
  4428.       int 16 itself.  Before calling an int, programs can place a number
  4429.       in the AH register of the CPU which tells the int which service to
  4430.       use.  Thus the expression "service 8 of DOS" means invoking the
  4431.       DOS interrupt (int 21H) with ah=8. Int 16 has several services
  4432.       including one (service 2) that tells a program the state of the
  4433.       shift keys (most programs directly look at byte 417H), one that
  4434.       tells the program whether there are any keystrokes to waiting to be
  4435.       processed (service 1) and one (service 0) that returns the next
  4436.       keystroke in the buffer, waiting for a stroke if there isn't one
  4437.       there.  If int 16, service 0 is called, then when control is passed
  4438.       back to the application program, ah contains the "scan code" part
  4439.       of the next keystroke and al the ASCII part.  The application
  4440.  
  4441.  
  4442.       Chapter VI:ADVANCED TOPICS                                 Page 82
  4443.  
  4444.  
  4445.  
  4446.  
  4447.                         Documentation for STACKEY, Version 4.0 
  4448.  
  4449.  
  4450.       program is perfectly able to distinguish top row plus and grey
  4451.       plus, for example.
  4452.  
  4453.             DOS service 8 calls int 16 and proceeds to throw some of the
  4454.       information away!  Only the ASCII part of the code is returned to
  4455.       the calling program.  If this ASCII code part is zero (corresponding
  4456.       to a key combination which doesn't correspond to an ordinary ASCII
  4457.       code), then and only then, can the program get additional
  4458.       information - if DOS service 8 is immediately called again, the
  4459.       scan code part is returned which explains why it is called "second
  4460.       ASCII code".  Using the DOS service, a program cannot distinguish
  4461.       the top row plus and the grey plus.  Why use the DOS service instead
  4462.       of int 16?   About the only virtue is that you can redirect input and
  4463.       have the input used if you call the DOS service 8.  There are many
  4464.       disadvantages.  Why do some programs still persist in using the DOS
  4465.       service?  For some, it is a holdover from the era of MS-DOS
  4466.       machines; these were not 100% IBM compatible machines.  The idea
  4467.       was that while these machines might have a somewhat incompatible
  4468.       BIOS, they'd react properly to the DOS call.  For some, it is
  4469.       because their compiler insists on calling DOS.  Ironically some
  4470.       compilers (Turbo Pascal is an example!) mimic the behavior of the
  4471.       DOS call and it is recommended that with such compilers, you
  4472.       include your own int 16 routine for getting keyboard input.
  4473.  
  4474.             Most programs that flush the keyboard buffer, do it by
  4475.       calling int 16, service 1 and seeing if there is a keystroke
  4476.       waiting.  If there is, then they call service 0, get the keystroke
  4477.       and ignore it.  They then loop until they are told by service 1
  4478.       that no keys remain in the buffer.
  4479.  
  4480.             In principle, a program could bypass int 16 and directly
  4481.       remove strokes from the buffer.  Fortunately no programs do so (as
  4482.       far as we know), since such programs will have a tendency not to
  4483.       work with keyboard macro programs.  But some programs completely
  4484.       ignore int 16 and have their own keyboard handlers replacing both
  4485.       int 9 and int 16 and the BIOS buffers.  SMARTCOM II is a good
  4486.       example of this.  If you use STACKEY before loading SMARTCOM,
  4487.       you'll find that the keystrokes don't get acted on by SMARTCOM but
  4488.       appear on the screen when you exit.  This is because STACKEY places
  4489.       strokes in buffer where SMARTCOM ignores them but they get read
  4490.       when you exit SMARTCOM.  There is nothing that can be done to get
  4491.       STACKEY to work with a program like that.
  4492.  
  4493.  
  4494.  
  4495.  
  4496.       Chapter VI:ADVANCED TOPICS                                 Page 83
  4497.  
  4498.  
  4499.  
  4500.  
  4501.                         Documentation for STACKEY, Version 4.0 
  4502.  
  4503.  
  4504.       VI.5 Keyboard Basics: How other programs work
  4505.  
  4506.             To understand how STACKEY works, it is useful to have some
  4507.       idea of how various kinds of other programs work.  Keyboard macro
  4508.       programs generally have two distinct parts - one that enhances int 9
  4509.       and the other enhances int 16.  The int 9 enhancement allows the
  4510.       macro program to react to strokes like Ctrl-Up which BIOS ignores.
  4511.       (Actually, the BIOS with the enhanced keyboard does interpret Ctrl-
  4512.       Up so this statement is only true of the older BIOS.)  Each macro
  4513.       program has a different set of codes used for these non-BIOS
  4514.       keystrokes - alas there is no standard - but the well known ones
  4515.       all put a word in the buffer corresponding to these strokes.  Then
  4516.       their int 16 module looks at what the "real" int 16 is about to
  4517.       report - the older BIOS would pass these strange words through.
  4518.       Since the macro program worries that the calling program won't know
  4519.       what to make of this non-standard code, if you haven't made Ctrl-up
  4520.       into a macro, the macro program will eat the non-standard code.  If
  4521.       the key is a macro key, then the macro program will return the
  4522.       strokes in the macro as int 16 is successively called.
  4523.  
  4524.             Type ahead buffer extenders typically work by seeing if the
  4525.       buffer is about to fill and if so they remove the stroke from the
  4526.       buffer and place it in their buffer.  Depending on how they are
  4527.       implemented they'll continually take out and put in the last stroke
  4528.       in the buffer or all of them.
  4529.  
  4530.             Several programs promise to improve on BIOS' typematic by
  4531.       eliminated the dreaded "cursor overshoot"  (oh horrors!).  If you
  4532.       hold down the arrow key when your application program isn't ready or
  4533.       in a situation where it can't process strokes fast enough, then BIOS
  4534.       will fill the buffer with the code for that arrow key.  The more
  4535.       intelligent typematic programs place the extra strokes in not by
  4536.       using the buffer but by stealing int 16 and responding that there is
  4537.       an arrow key ready.  In this way, they'll give strokes just at the
  4538.       rate that the application can take it and you'll get "stop on a
  4539.       dime" behavior.
  4540.  
  4541.  
  4542.       VI.6 Keyboard basics: How STACKEY works (or doesn't)
  4543.  
  4544.             STACKEY's most basic function is to simulate the entering of
  4545.       ordinary keystrokes.  It does this by placing them in the buffer.
  4546.       When smart or impatient processing is in effect, STACKEY checks
  4547.       every clock tick and if it has keystrokes waiting to be placed in
  4548.  
  4549.  
  4550.       Chapter VI:ADVANCED TOPICS                                 Page 84
  4551.  
  4552.  
  4553.  
  4554.  
  4555.                         Documentation for STACKEY, Version 4.0 
  4556.  
  4557.  
  4558.       the buffer, it places as many as it can without overfilling the
  4559.       buffer.  If there is no room, it will do nothing.  If your
  4560.       application can process them that fast, STACKEY can place as many as
  4561.       18.2*15=about 270 keystrokes per second in the buffer. However,
  4562.       STACKEY doesn't prevent int 9 from being processed in the middle, so
  4563.       if you hit a key, it may wind up in the middle of the playback.
  4564.  
  4565.             The non-resident part of STACKEY keeps a translation table to
  4566.       tell it what each special symbol keystroke and letter corresponds to
  4567.       and it just places the corresponding words in STACKEY's internal
  4568.       buffer.  So you understand why each "keystroke" takes two bytes and
  4569.       the 128 keystroke default buffer is 256 bytes.  STACKEY reserves the
  4570.       "scan codes" E0 and above to tell it that a special command is in
  4571.       the buffer, like a delay or repeat.  However, XF012 would still
  4572.       work; it would place a word F012 in the keyboard buffer but the
  4573.       intermediate codes in STACKEY's buffer wold take a third byte to
  4574.       warn STACKEY that the F0 wasn't a command.
  4575.  
  4576.             Since STACKEY is only simulating the result of hitting a key
  4577.       rather than the hitting of the key itself, custom routines are
  4578.       needed to simulate each "keystroke" that doesn't place a key in the
  4579.       buffer.  Since BIOS does nothing when Ctrl-Up is hit, STACKEY has
  4580.       no primitive command for Ctrl-Up.  If your macro program or
  4581.       application program gives meaning to this stroke it is probably by
  4582.       placing its own idiosyncratic code in the buffer.  If you can find
  4583.       out what codes it is using, you can simulate them with the Xnnnn
  4584.       command.  (For some macro programs, CTRLALT PLUS' ^@R command or
  4585.       CTRLALT's ^@T which reports on what int 16 is saying will let you
  4586.       see what codes your macro program is using.)
  4587.  
  4588.             STACKEY simulates a shift depress by saving the byte at
  4589.       address 417 and changing it for the specified number of ticks to the
  4590.       requested value and then it restores the original value.  Programs
  4591.       that pop up on the shift keys do so by checking byte 417 each tick so
  4592.       they will get fooled by STACKEY.  In principle a program could popup
  4593.       on Alt+LShift by sitting on int 9 and seeing if the key hit is Alt
  4594.       or LShift and then checking whether the complementary shift is
  4595.       depressed.  The only programs we know of that do this are in the
  4596.       SWAPxx series and they do not pop up on STACKEY's SH command -
  4597.       fortunately as Tesseract programs, you can use the TE command
  4598.       instead.  There is an extra complication with the SH command that
  4599.       you should be aware of.  Suppose that you have a SH(AL,18) stacked
  4600.       and you have the Alt key depressed when the processing of the SH
  4601.       command begins.  But during the processing of the SH command, you
  4602.  
  4603.  
  4604.       Chapter VI:ADVANCED TOPICS                                 Page 85
  4605.  
  4606.  
  4607.  
  4608.  
  4609.                         Documentation for STACKEY, Version 4.0 
  4610.  
  4611.  
  4612.       remove your finger from the Alt key (18 ticks is a full second
  4613.       after all). When STACKEY restores the initial state of the shifts,
  4614.       it will restore the Alt key down bit and even though your aren't
  4615.       depressing the Alt key, the keyboard will act as if you are!
  4616.       Pressing and releasing the Alt key should cure this problem, which
  4617.       fortunately should be rare.
  4618.  
  4619.             STACKEY's hotkey processing is done on int 9.  Thus if you
  4620.       have used a keyboard mapping program and changed the keytops,
  4621.       STACKEY for its hotkeys will be sensitive to the original meaning of
  4622.       the keys, not their remapped meaning.  For example, on an AT you
  4623.       might physically interchange the <Esc> and <`/~> keys and use a
  4624.       program like FANSI CONSOLE to correct for the action of the keys.
  4625.       However, if you want Alt-<Esc> to be the H+ hotkey (where by <Esc>
  4626.       you mean the key currently marked <Esc>), you'll need to use
  4627.             stackey H+(A,"`")
  4628.       since a keyboard mapper can't fool programs that sit on int 9 and
  4629.       STACKEY's int 9 handler doesn't know that you've swapped keytops.
  4630.  
  4631.             Above, we described how program tend to flush the buffer.  If
  4632.       you have 100 strokes in the STACKEY buffer, the way STACKEY works by
  4633.       default, those strokes will all get cleared out by many such schemes
  4634.       (although if the program is doing things quickly enough, it may
  4635.       clear out the BIOS buffer and find that empty before the next clock
  4636.       tick when STACKEY will refill the buffer).  You should be able to
  4637.       figure out why the PH keystroke will fool such flushers.
  4638.  
  4639.             Some programs, flush the buffer after getting any keystroke,
  4640.       disabling type ahead!  You should be able to understand why patient
  4641.       processing will normally deal with such programs.
  4642.  
  4643.             You'll find that you have to fine tune STACKEY in many ways to
  4644.       get it to overcome some strange scheme that a program has to flush
  4645.       the buffer or otherwise force you to do things its way.  It is
  4646.       unfortunate that programs work that way but if all programs worked
  4647.       properly, you wouldn't have much need for STACKEY - they would allow
  4648.       you on the command line to do what you must make a STACKEY script to
  4649.       do instead.  When a difficulty does occur, it may pay to try to use
  4650.       the knowledge in this tutorial to figure out what is going on.  We
  4651.       hope that the tools we have provided in STACKEY will let you
  4652.       overcome the difficulty.  If they don't, please let us know so we
  4653.       can attempt to add even more flexibility to STACKEY to let it solve
  4654.       those problems.
  4655.  
  4656.  
  4657.  
  4658.       Chapter VI:ADVANCED TOPICS                                 Page 86
  4659.  
  4660.  
  4661.  
  4662.  
  4663.                         Documentation for STACKEY, Version 4.0 
  4664.  
  4665.  
  4666.       VI.7 Inline: Syntax
  4667.  
  4668.             Important note: STACKEY's INLINE code is powerful but
  4669.       dangerous and should only be used by those adept in assembly
  4670.       language programming.  When experimenting, act the way you would
  4671.       if you were debugging an assembly language program.  Be careful to
  4672.       be in a situation where a crash wouldn't lose any work.
  4673.  
  4674.             The syntax for inline code is:
  4675.             stackey IL(xx/xx/xx/xx/xx)
  4676.       where xx are hex numbers from 00 to FF.  The hex digits A-F can be
  4677.       either uppercase of lower case; do not add an explicit H.  When
  4678.       this set of commands is reached in the STACKEY script, that
  4679.       sequence of bytes will be executed as a sequence of machine
  4680.       language instructions.  Before they get issued, STACKEY pushes the
  4681.       ax,bx,cx and dx registers and when the code is done, it issues a
  4682.       RET instructions and then it pops these registers.  Thus the IL
  4683.       code can freely use the ax,bx,cx,dx registers and it can also use
  4684.       the si,ds and es registers.  Before using any other registers
  4685.       (bp,di,sp,ss,cs), be sure to push them and subsequently pop them.
  4686.       It is important that you note that STACKEY appends a RET
  4687.       instruction to the IL code so need not add one yourself; you cab
  4688.       use a RET but do not use an IRET or a FAR RET.
  4689.  
  4690.             When your code is called, cs=ds=the resident code's segment
  4691.       and es=40H, the BIOS data area.  Moreover si points to the offset
  4692.       of the first instruction; see below.   The 6 byte area ds:42H-
  4693.       ds:47H is available for user data storage; below methods are given
  4694.       for additional storage if you wish.  The word at ds:40h is the
  4695.       segment of the screen (B000 or B800).
  4696.  
  4697.             THE CODE MUST BE FULLY RELOCATABLE.  RELATIVE JUMPS ARE FINE
  4698.       BUT ABSOLUTE JUMPS ARE NOT.  STACKEY does not have its own stack
  4699.       but uses the underlying programs stack.  If you have a need for a
  4700.       large stack (only relevant if you are using an external command),
  4701.       you'll need to set one up in your inline code.  To do this you
  4702.       might need to get access to the absolute position of your code.  One
  4703.       way of doing this is to use the following inline fragment:
  4704.             \E8\00\00\58\
  4705.       (which translates as
  4706.            call $+3
  4707.            pop ax)
  4708.       will place the address of the 58 instruction (relative to CS:0000)
  4709.       in the AX register.  Another way is to use the fact that si points to
  4710.  
  4711.  
  4712.       Chapter VI:ADVANCED TOPICS                                 Page 87
  4713.  
  4714.  
  4715.  
  4716.  
  4717.                         Documentation for STACKEY, Version 4.0 
  4718.  
  4719.  
  4720.       the initial instruction when your inline code is loaded.  So you could
  4721.       get a data or stack area with
  4722.            jmp short overdata      ;or, jmp short $+10  for 4 words data
  4723.            dw 0,0,0,0
  4724.            overdata:
  4725.            ...
  4726.            ...
  4727.            mov [si+2], ax       ;si+2 points to beginning of "data"
  4728.  
  4729.             Be warned that if you use this idea (or the special value of es)
  4730.       in external files, you will not be able to debug them from DOS since
  4731.       DOS loads com files with si=00 and es=cs.
  4732.  
  4733.             A STACKEY inline call of n bytes takes n+3 bytes of buffer
  4734.       space (recall that a "keystroke" takes two bytes) including the
  4735.       final ret.  And the resident code to implement inline instructions
  4736.       takes only about 50 bytes!
  4737.  
  4738.  
  4739.       VI.8 External: Syntax
  4740.  
  4741.             STACKEY also has a command to allow you to stack a compiled
  4742.       com or bin file in the place of an inline string.  The syntax is
  4743.              stackey EX(filename)
  4744.       where filename can include a drive and or path if you wish.  You
  4745.       may use any extension that you wish but it must be included as part
  4746.       of the name.  The file MUST end in a RET instruction (and not in a
  4747.       call to DOS service 4C, for example) and obey all the rules for
  4748.       inline code except the rule about no final RET (we save the inline
  4749.       writer from having to add the RET by hand but for testing COM
  4750.       files, we assume you'll want the RET on the external file).
  4751.       STACKEY will complain if there is no final RET instruction.  An EX
  4752.       command to a file of n bytes ending in ret is completely equivalent
  4753.       to an IL command of the n-1 bytes preceding the RET.
  4754.  
  4755.             The size of the external file is only limited to the size of
  4756.       STACKEY's buffer.
  4757.  
  4758.             Since an EX command requires an extra file, we'd imagine that
  4759.       you'll use EX while debugging and then translate it to IL code
  4760.       unless the code is too long to fit as IL on the DOS command line.
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.       Chapter VI:ADVANCED TOPICS                                 Page 88
  4767.  
  4768.  
  4769.  
  4770.  
  4771.                         Documentation for STACKEY, Version 4.0 
  4772.  
  4773.  
  4774.       VI.9 Inline and External examples
  4775.  
  4776.             Here are some examples of how to use IL:
  4777.  
  4778.       Example 1. Pure Illustration
  4779.  
  4780.             stackey SC(hi) IL(b8/7/e/cd/10) ' Hello to you too.'
  4781.  
  4782.       The IL code is for
  4783.               mov  ax,0E07H
  4784.               int  10H
  4785.  
  4786.       In this example, STACKEY will scan for the word "hi" and the IL
  4787.       code will issue a BIOS beep (service E of int 10 with a character
  4788.       of ^G) and then answer you back.
  4789.  
  4790.  
  4791.       Example 2. Hide the cursor
  4792.  
  4793.             stackey IL(b4/1/b9/0/20/cd/10)
  4794.  
  4795.       This is equivalent to
  4796.               mov ax,1
  4797.               mov cx,2000H
  4798.               int 10H
  4799.       and will hide the cursor in real time.
  4800.  
  4801.  
  4802.       Example 3. Wait for a keystroke and eat it.
  4803.  
  4804.             stackey IL(31/c0/cd/16)
  4805.  
  4806.       equivalent to
  4807.             xor ax,ax
  4808.             int 16H
  4809.  
  4810.  
  4811.       Example 4. Send a FF to the printer.
  4812.  
  4813.             stackey IL(ba/00/00/b0/OC/cd/17)
  4814.  
  4815.       equivalent to
  4816.             mov dx,0
  4817.             mov al,0CH
  4818.  
  4819.  
  4820.       Chapter VI:ADVANCED TOPICS                                 Page 89
  4821.  
  4822.  
  4823.  
  4824.  
  4825.                         Documentation for STACKEY, Version 4.0 
  4826.  
  4827.  
  4828.             int 17H
  4829.  
  4830.       Example 5. Getting and restoring the shift status
  4831.  
  4832.             stackey IL(26/A0/17/00/3E/A2/42/00/26/C6/06/17/00/0A/...
  4833.                          3E/A0/42/00/26/A2/17/00)
  4834.  
  4835.       translates to
  4836.             mov al,es:[17h]               ;get shift states - es=400
  4837.             mov ds:[42h],al               ;save it
  4838.             mov byte ptr es:[17h],0ah     ;set alt-shift
  4839.        and after some intermediate code
  4840.             mov     al,ds:[42h]
  4841.             mov     es:[17h],al            ;restore
  4842.  
  4843.       Example 6.
  4844.             You could write your elaborate resident program accessed by
  4845.       one of the user interrupts and call it up with STACKEY inline code
  4846.       calling that interrupt.
  4847.  
  4848.       Example 7.  Flash the screen
  4849.             This involves the sample code flash.asm and its compiled bin
  4850.       file flash.bin.  What it does is XOR all bytes in screen memory
  4851.       with 07F, count to 64K and XOR back.  The effect is to flash the
  4852.       screen so
  4853.             stackey  :1 w5 ex(flash.bin) be j1
  4854.       will get your attention that a process has stopped; use the H!
  4855.       hotkey to flush out those instructions.
  4856.  
  4857.       Example 8.  Play music
  4858.             Music.asm is source for the file gavotte.bin which will play
  4859.       a Bach gavotte with
  4860.             stackey ex(gavotte.bin)
  4861.       There are also a Monteverdi piece (montev.bin) and for the really
  4862.       highbrow pop goes the weasel (pop.bin).  Music.asm is a shell and
  4863.       you can use it to write your own external music files. You might
  4864.       try
  4865.             stackey :1 ex(gavotte.bin) WH j1
  4866.       which will play the gavotte whenever you hit the H+ hotkey.  Of
  4867.       course, you won't be able to use STACKEY for anything else.
  4868.  
  4869.       Example 9.  Messages
  4870.             The shell makemess.asm is source code for sample.msg but has
  4871.       directions for modification.  By jumping to labels called label1,
  4872.  
  4873.  
  4874.       Chapter VI:ADVANCED TOPICS                                 Page 90
  4875.  
  4876.  
  4877.  
  4878.  
  4879.                         Documentation for STACKEY, Version 4.0 
  4880.  
  4881.  
  4882.       label2, etc in this source code, when run the external file will
  4883.       jump to STACKEY labels 1, 2, etc.  The sample file jumps to label 1
  4884.       if you hit Y and label 2 if you hit N.  Thus the command
  4885.             stackey  EX(sample.msg) :1 BE 'yes' J0  :2 'no'
  4886.       will pop up a message box and either beep and enter the string
  4887.       'yes' through the keyboard if you answer Y or enter the string 'no'
  4888.       if you enter N.   Notice since there is no label 0, j0 exits the
  4889.       command line.
  4890.  
  4891.       Example 10. Disable/Reenable the keyboard
  4892.             This example is potentially very dangerous!  The following
  4893.       code will disable the keyboard:
  4894.             stackey IL(B0/AD/E6/64)
  4895.       and can be used in scripts where you want to be sure that the user
  4896.       will not interrupt.  Only use it after you have thoroughly debugged
  4897.       the rest of the script.  To reenable the keyboard use instead
  4898.       stackey IL(B0/AE/E6/64).  However, be warned that some keyboards
  4899.       will save up keystrokes while disabled and issue them when
  4900.       reenabled.  For this reason, you may want to also flush the keyboard
  4901.       as well as reenable it.  An external program flush.bin is provide
  4902.       that does this or you can use
  4903.             stackey IL(B0/AE/E6/64/33/C9/E2/FE/B4/01/CD/16/
  4904.                           74/06/32/E4/CD/16/EB/EC)
  4905.  
  4906.  
  4907.       VI.10 STACKEY's API
  4908.  
  4909.             To talk to application programs, STACKEY takes over some unused
  4910.       int 16 services.  All calls require AH=CA (that's CA Hex but think of it
  4911.       as the initials of CTRLALT Associates; CTRLALT PLUS' API also uses int
  4912.       16 but with other values of BX and CX).  It is also required that
  4913.       BX=CX=736BH ('sk').  AL must be one of 0, 1 or 2 and this value
  4914.       indicates the "service number" below.  Any other values of AX,BX,CX
  4915.       will be passed on by STACKEY. Three bytes of user stack are used in
  4916.       addition to the 5 required by an interrupt.
  4917.  
  4918.             If STACKEY services an API call, it ALWAYS RETURNS
  4919.                     AX=CAFF
  4920.                     BX=Code segment of SK
  4921.                     CX=Version of SK      (CH=major,CL=minor)
  4922.       The API is only applicable for version 3.0 and later of STACKEY.
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.       Chapter VI:ADVANCED TOPICS                                 Page 91
  4929.  
  4930.  
  4931.  
  4932.  
  4933.                         Documentation for STACKEY, Version 4.0 
  4934.  
  4935.  
  4936.             Here are the STACKEY API services:
  4937.  
  4938.               service 0:  Are you there?
  4939.                  Returns:   DX=Words free
  4940.  
  4941.               service 1:  Put word in buffer
  4942.                       DX=word to place in buffer
  4943.                  Returns:   DX=number of words remaining in
  4944.                       buffer if successful, FFFF if unsuccessful.
  4945.                       [The only reason for unsuccess is a full buffer.]
  4946.  
  4947.               service 2: Flush STACKEY and BIOS buffers
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.       Chapter VI:ADVANCED TOPICS                                 Page 92
  4983.  
  4984.  
  4985.  
  4986.  
  4987.                         Documentation for STACKEY, Version 4.0 
  4988.  
  4989.  
  4990.  
  4991.                          Chapter VII:ASSOCIATED PROGRAMS
  4992.       VII.1 FILEKEY
  4993.  
  4994.             A separate program called FILEKEY is included which lets you
  4995.       read an entire file into STACKEY's buffer.  STACKEY must be loaded
  4996.       in memory before FILEKEY is invoked or else you will get an error
  4997.       message.   The syntax is
  4998.             filekey <filename>
  4999.       where filename can include a drive and/or path.
  5000.  
  5001.             The file read by FILEKEY should be a standard ASCII file.
  5002.       FILEKEY reads the file into the stack as literal keystrokes with
  5003.       each CR/LF pair (line ending) replaced by a CR.  A final CR is
  5004.       automatically included (but see below).  Thus the two line ASCII
  5005.       file (NOTE: FILEKEY does not ignore leading blanks; for
  5006.       typographical reasons we indent the examples but we describe what
  5007.       would happen if the file lines began in column 1):
  5008.             Now is the time
  5009.             for all good men
  5010.       would be read by FILEKEY as if the command
  5011.             stackey "Now is the time"CR"for all good men"CR
  5012.       were entered at the DOS command line.
  5013.  
  5014.             $ plays the role of a special escape character in the
  5015.       processing by FILEKEY.  If the $ is followed by any character, but
  5016.       ; or another $, then the $ gets passed through in the usual way.
  5017.  
  5018.             "$;" tells FILEKEY to ignore the remainder of the line and
  5019.       not place a CR at the end of that line.  Thus, to avoid having a CR
  5020.       stacked at the end of the final line end the file with $;.  For
  5021.       example, the following file would be equivalent to the last STACKEY
  5022.       example:
  5023.             Now is the $;
  5024.             time
  5025.             $;this is a comment
  5026.             for all $; this is another comment
  5027.             good men
  5028.  
  5029.             $$ tells FILEKEY to toggle to a mode where it reads the
  5030.       file as if it were STACKEY reading a command line with five
  5031.       exceptions:
  5032.             $$ is no longer interpreted as a single $
  5033.             lines are automatically wrapped; i.e. a literal CR/LF (but
  5034.  
  5035.  
  5036.       Chapter VII:ASSOCIATED PROGRAMS                            Page 93
  5037.  
  5038.  
  5039.  
  5040.  
  5041.                         Documentation for STACKEY, Version 4.0 
  5042.  
  5043.  
  5044.                not the letter CR or LF) is ignored.
  5045.             utilities mode cannot be called from a file
  5046.             /../ commands cannot be issued
  5047.             permanent palette changes cannot be made $$ will toggle back
  5048.       to the default mode.  Thus the following file is also equivalent to
  5049.       the last STACKEY example:
  5050.             Now is the time$$CR$$for all good men$$CR$$$;
  5051.       The final $$$; is unnecessary.
  5052.  
  5053.             If you want to imbed $$ in the stack from a file, use
  5054.             $$"$$"$$
  5055.       and similarly for $;.
  5056.  
  5057.             Note that [] color changes are allowed in FILEKEY's $$-mode
  5058.       but not permanent palette changes.  This is because the permanent
  5059.       palette changes are utilities.  SC, SS, SH, EX, and IL are all
  5060.       allowed commands after toggling with $$.  Hotkey changes are also
  5061.       allowed in $$-mode.
  5062.  
  5063.             If you use FILEKEY for large scripts you may find that
  5064.       STACKEY's limitation of 10,000 keystrokes in the buffer is
  5065.       insufficient (it surprised us when we got requests for a large
  5066.       buffer but we did from several sources!).  Note that with SKRES,
  5067.       you can load STACKEY with a buffer size of 30,000 bytes, see
  5068.       Section III.12.  FILEKEY itself is limited to reading in files of no
  5069.       more than 54,000 bytes.
  5070.  
  5071.  
  5072.       VII.2 SKREC and SKGET
  5073.  
  5074.             STACKEY now includes a program to record STACKEY scripts.
  5075.       SKREC is a resident program you load (and can later unload) which
  5076.       will record keystrokes.  It stores the keystrokes in memory and
  5077.       allows you to add waits and scan interactively in a script.  When
  5078.       you later run SKGET, it will translate the script stored in memory
  5079.       to either STACKEY or FILEKEY syntax and save it to a file.
  5080.  
  5081.             SKREC takes the following command line parameters when it
  5082.       loads (the buffer and shift mask are described below):
  5083.             SKREC                 will install SKREC (with a 2000 byte
  5084.                                       buffer)
  5085.             SKREC b=nnnn s=nn     will install SKREC with a Buffer of
  5086.                                       nnnn bytes and "Shift mask" nn for
  5087.                                       the hotkeys
  5088.  
  5089.  
  5090.       Chapter VII:ASSOCIATED PROGRAMS                            Page 94
  5091.  
  5092.  
  5093.  
  5094.  
  5095.                         Documentation for STACKEY, Version 4.0 
  5096.  
  5097.  
  5098.             SKREC r               will Reset SKREC (i.e., empty the
  5099.                                        buffer)
  5100.             SKREC u               will Uninstall SKREC
  5101.             SKREC ?               brings up a screen of help
  5102.  
  5103.             Once you start recording SKREC stores keystrokes in a buffer.
  5104.       Each keystroke takes two bytes of buffer so the 2000 byte default
  5105.       allows 1000 keystrokes.  You can change the buffer size by adding
  5106.                 b=nnnn
  5107.       to the load command line.  nnnn can be anything up to 50000 (that is
  5108.       25,000 keystrokes).  You will not get an error message if you try a
  5109.       number larger than 50000 but the resulting buffer size may not be
  5110.       what you want.  SKREC's resident size is slightly under 5K plus the
  5111.       size of the buffer, that is roughly 7K for the default size.
  5112.  
  5113.             IF SKREC is the last program loaded into memory, you can
  5114.       unload it with the command line
  5115.               SKREC u
  5116.       If it is not safe to unload because some program has ben loaded
  5117.       after it, SKREC will report:
  5118.             It may not be safe to uninstall SKREC; no action taken.
  5119.  
  5120.             Once you start recording, you can start/stop recording with
  5121.       hotkeys.  To reset the SKREC buffer, you need to use
  5122.               SKREC R
  5123.  
  5124.             While loaded you talk to SKREC with a set of hotkeys.  By
  5125.       default these hotkeys are Alt-LeftShift plus a letter.  You change
  5126.       the shift mask used, i.e. replace Alt+Left by using
  5127.               SKREC s=nn
  5128.       You get the shiftmask by adding to together the values according to
  5129.               1 (RightShift)
  5130.               2 (LeftShift)
  5131.               4 (Ctrl)
  5132.               8 (Alt)
  5133.       so the default value is 10 and, for example
  5134.               SKREC b=10000 s=12
  5135.       would load SKREC and set the hot keys to Ctrl+Alt+letter and the
  5136.       buffer to 10000 bytes.
  5137.  
  5138.             Once loaded, the hotkeys are as follows:
  5139.  
  5140.                 AL-[  or  AL-grey+       to start recording keystrokes
  5141.                 AL-]  or  AL-grey-       to stop recording keystrokes
  5142.  
  5143.  
  5144.       Chapter VII:ASSOCIATED PROGRAMS                            Page 95
  5145.  
  5146.  
  5147.  
  5148.  
  5149.                         Documentation for STACKEY, Version 4.0 
  5150.  
  5151.  
  5152.                 AL-C                     to insert any STACKEY Commands into
  5153.                                            the script
  5154.                 AL-S                     to allow the marking of a string to
  5155.                                            be Scanned for
  5156.                 AL-W                     to record a Wait (delay) equal to the
  5157.                                            length of time elapsed since the
  5158.                                            last keystroke
  5159.                 AL-Backspace             to delete the last recorded
  5160.                                             keystroke, Commands, Scan, or Wait
  5161.  
  5162.       Loading SKREC does not start recording.  You must explicit do that
  5163.       with the start hotkey.  You can pause recording with the stop key.
  5164.       Hitting AL-W will place a wait into the script of the amount of time
  5165.       since the last key hit.
  5166.  
  5167.             Hitting AL-S will allow you to interactively mark an area of
  5168.       the screen for scanning.  The arrows move the block and +/-
  5169.       increase/decrease the block size.  When you hit enter, you have a
  5170.       choice of making a fixed position or at the cursor scan command or
  5171.       of aborting the scan.  The text in the marked block is placed in the
  5172.       scan.  The scan is recorded as an SC.  If you wish an SS, SJ or SU,
  5173.       you'll need to edit the resulting script.
  5174.  
  5175.             AL-C lets you type in any other command you might want such
  5176.       as BE.  No error checking is done although a few 'standard' commands
  5177.       are given to help remind you.
  5178.  
  5179.             If you make a mistake, it will often be best to exit your
  5180.       program, reset and start all over but if the error is small AL-
  5181.       Backspace will undo the last action.  It can be done multiple times
  5182.       back to emptying the entire buffer.
  5183.  
  5184.             After you are finished recording, turn off the record and
  5185.       return to DOS.  Running SKGET will store the in-memory script to
  5186.       disk
  5187.             skget filename
  5188.       will store it in STACKEY format and
  5189.             skget filename /f
  5190.       in FILEKEY format.
  5191.  
  5192.             For example, if you have recorded six keystrokes <a>, <b>,
  5193.       <c>, <Esc>, <Ctrl-C>, and <Enter> and then try
  5194.             SKGET  foo.bat
  5195.       you will find a file 'foo.bat' in the current directory which
  5196.  
  5197.  
  5198.       Chapter VII:ASSOCIATED PROGRAMS                            Page 96
  5199.  
  5200.  
  5201.  
  5202.  
  5203.                         Documentation for STACKEY, Version 4.0 
  5204.  
  5205.  
  5206.       consists of one line
  5207.             stackey "abc" es ^C cr
  5208.       while
  5209.             SKGET foo.txt /f
  5210.       would produce the lines
  5211.              abc$$
  5212.              es ^c cr
  5213.  
  5214.             SKGET will warn you if the filename already exists and will
  5215.       use multiple STACKEY lines if needed.
  5216.  
  5217.  
  5218.       VII.3 EGAPAL and VGAPAL
  5219.  
  5220.             The EGA and VGA allow one to keep permanent palettes and non-
  5221.       standard fonts in tables in RAM.  By default, they are stored in
  5222.       ROM but by moving those tables to RAM, one can set permanent
  5223.       palettes different from the default.  Permanent here does not mean
  5224.       surviving rebooting, only surviving a change of mode.   Included
  5225.       with STACKEY are programs that move these permanent palettes.  You
  5226.       can only use STACKEY's permanent palette setting with the supplied
  5227.       EGAPAL, VGAPAL or with the commercial program ULTRAVISION.
  5228.  
  5229.             EGAPAL replaces the DWORD1 program supplied with STACKEY 2.0.
  5230.       Please use EGAPAL rather than DWORD1.  EGAPAL will refuse to load with
  5231.       a VGA - DWORD1 will load but should not be used.  Instead, use VGAPAL.
  5232.  
  5233.             If you are not running any other EGA/VGA specific programs
  5234.       that use palettes or fonts, you need just run EGAPAL or VGAPAL in
  5235.       your AUTOEXEC.BAT and forget about it.  You'll then have access to
  5236.       the permanent palette setting.  DO NOT REMOVE EGAPAL FROM MEMORY
  5237.       WITH old versions of MARK/RELEASE WITHOUT FIRST RUNNING "EGAPAL Q"
  5238.       AS DESCRIBED BELOW.  If you ignore this warning and you are using
  5239.       these early versions of MARK/RELEASE, you will crash rather
  5240.       spectacularly although we think that you will not hurt your
  5241.       monitor. The more recent versions of MARK/RELEASE and CTRLALT PLUS'
  5242.       ^@<F9>Y command automatically restore the DWORD1 pointer that
  5243.       EGAPAL/VGAPAL change.
  5244.  
  5245.             The first time that you run EGAPAL, it remains resident
  5246.       taking 1600 bytes of RAM most of it in the tables (1472 bytes)
  5247.       that store the palettes.  VGAPAL takes 224 bytes.  In addition to
  5248.       this memory, memory will be taken for a copy of your current
  5249.       environment (see BATUTIL documentation, Section V.1).
  5250.  
  5251.  
  5252.       Chapter VII:ASSOCIATED PROGRAMS                            Page 97
  5253.  
  5254.  
  5255.  
  5256.  
  5257.                         Documentation for STACKEY, Version 4.0 
  5258.  
  5259.  
  5260.             If EGAPAL/VGAPAL finds that it is not already in memory but
  5261.       another EGA/VGA is, it will refuse to load.  Load EGAPAL/VGAPAL
  5262.       first and use the Q and R parameters.
  5263.  
  5264.             If EGAPAL/VGAPAL is run with no parameters (or with any
  5265.       parameters other than Q or R) it will look for itself in memory.
  5266.       If it finds itself, it exits with a message: "EGAPAL already
  5267.       loaded".  Otherwise it loads itself as described above.
  5268.  
  5269.             When EGAPAL loads, it saves the EGA/VGA address that were
  5270.       there before it loaded.  Running
  5271.             egapal Q
  5272.       (for Quit) will put these addresses back to what they were before
  5273.       EGAPAL loaded.  Running
  5274.             egapal R
  5275.       (for Restore) will put these addresses back to what they were after
  5276.       you initially ran EGAPAL.  If EGAPAL is run with one of these
  5277.       parameters and EGAPAL does not find itself in memory, it will exit
  5278.       with the message: "EGAPAL not loaded".  When looking for
  5279.       parameters, EGAPAL stops after the first one so it doesn't matter
  5280.       what appears after the first R or Q.  Any number of spaces, tabs or
  5281.       /'s can occur between 'egapal' and the Q or R.
  5282.  
  5283.             There are some programs (Microsoft CODEVIEW is an example)
  5284.       which react badly if the save_ptr region is in RAM.  Assuming that
  5285.       you loaded EGAPAL when save_ptr was pointing towards ROM, you need
  5286.       only run
  5287.             egapal q
  5288.       before such programs and
  5289.             egapal r
  5290.       afterwards.
  5291.  
  5292.             Do this also to use another program that is EGA/VGA specific
  5293.       and insists that it be loaded first.
  5294.  
  5295.  
  5296.       VII.4 Demonstration BATch files
  5297.  
  5298.             The STACKEY package comes with four demonstration BATch files
  5299.       to illustrate some of STACKEY's features.  You should run them (at
  5300.       least the appropriate ones for your monitor) and then study them to
  5301.       see how they work.
  5302.  
  5303.  
  5304.  
  5305.  
  5306.       Chapter VII:ASSOCIATED PROGRAMS                            Page 98
  5307.  
  5308.  
  5309.  
  5310.  
  5311.                         Documentation for STACKEY, Version 4.0 
  5312.  
  5313.  
  5314.             SOUNDS.BAT illustrates the BEEP command.  You should also look
  5315.       at BATUTIL's SOund command and soundemo.bat.
  5316.  
  5317.             CGACOLOR.BAT shows you how the L and P commands work on the
  5318.       CGA.  The full illustration of the L command requires the small
  5319.       stand alone program BOXES.COM to be in the default directory.  You
  5320.       should only use it with a color monitor.
  5321.  
  5322.             COLOR.BAT and SEECOLOR.BAT illustrate the temporary palette
  5323.       setting on the EGA.  Both take parameters.  COLOR will cycle
  5324.       through all 64 colors on the EGA.  With no parameter or an improper
  5325.       parameter, it displays a message and then runs the file with a
  5326.       default parameter value of 1.  The correct parameter is a single
  5327.       integer.  If the parameter is n, there is a pause of n/2 seconds
  5328.       between color changes.  If you find the switching time too short
  5329.       with the default try n=3 or 4.
  5330.  
  5331.             SEECOLOR will let you see any color or several colors.  You
  5332.       enter
  5333.             seecolor p1 p2...pn
  5334.       where each parameter is either a number (from 0 to 63) or a subset
  5335.       of RrBbGg and those colors will be displayed in order with a pause
  5336.       for keystroke in between.  If an illegal parameter is entered, the
  5337.       BATch file will abort with an error message.
  5338.  
  5339.             In addition to the basic commands they illustrate, these
  5340.       BATch files show other features of STACKEY.  For example, you
  5341.       should study how COLOR.BAT and SEECOLOR.BAT use redirection to nul
  5342.       and errorlevel to recover from command line errors.  And all the
  5343.       files except SEECOLOR make use of the wait command to control the
  5344.       timing of the BATch file.  The possibility of doing arithmetic on
  5345.       STACKEY's input parameters, discussed in the usage notes, is
  5346.       illustrated in COLOR.BAT.
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.       Chapter VII:ASSOCIATED PROGRAMS                            Page 99
  5361.  
  5362.  
  5363.  
  5364.  
  5365.                              Chapter VIII:MISCELLANY
  5366.  
  5367.  
  5368.       VIII.1 Usage notes
  5369.  
  5370.             STACKEY checks its numeric input and normally gives an error
  5371.       message Number out of range  if an integer is given over 64K or a
  5372.       number below 256 is required but one larger is given by the user.
  5373.       Colors which are supposed to be in the range 0 to 63 are reduced
  5374.       mod 64 so long as they are less than 256.
  5375.  
  5376.             Any place where STACKEY expects an integer, you can place a
  5377.       product by using a *.  Thus, "W2*35" will be interpreted as "W70".
  5378.       Thus if you want to accept input from a user in a BATch file in
  5379.       seconds rather than clock ticks, you can use "W18*%1".  In addition
  5380.       you can use + and - with multiplications done first.  For example,
  5381.       the timed waits in COLOR.BAT are arranged to run for 64*%1 (the
  5382.       time to show the 64 color changes) minus a fixed amount to take
  5383.       into account the time it takes for the color change commands to
  5384.       load.
  5385.  
  5386.             Note that while DOS normally interprets >,< and | as
  5387.       redirection commands, if enclosed between double quotes, it gets
  5388.       passed as part of the commands line, so these symbols can be
  5389.       stacked by placing them between double quotes (but not between
  5390.       single quotes).  If you prefer, you can use the $g,$l and $q
  5391.       metastrings.
  5392.  
  5393.             You can use STACKEY to make a batch file that will change the
  5394.       date and time of a file to one you specify.  The following
  5395.       redate.bat file has the syntax:
  5396.             redate <filespec>
  5397.       to change the date and time to the current one and
  5398.             redate <filespec> date time
  5399.       to the specified date and time.  <filespec> can include wildcards:
  5400.             echo off
  5401.             cls
  5402.             if "%2" == "" goto nodate
  5403.             stackey $tCR
  5404.             if "%3" == "" goto notime
  5405.             time %3
  5406.             :notime
  5407.             stackey $M"-"$D"-"$YCR
  5408.             date %2
  5409.             :nodate
  5410.             for %%a in (%1) do copy/b %%a+,,
  5411.             if "%2" == "" goto morenoda
  5412.  
  5413.  
  5414.       Chapter VIII:MISCELLANY                                   Page 100
  5415.  
  5416.  
  5417.  
  5418.  
  5419.                         Documentation for STACKEY, Version 4.0 
  5420.  
  5421.  
  5422.             if "%3" == "" goto morenoti
  5423.             time
  5424.             :motenoti
  5425.             date
  5426.             :morenoda
  5427.       The stacked date and time restore the current values (your clock
  5428.       will lose a few seconds).
  5429.  
  5430.             One of the annoyances faced by DOS users is the seeming
  5431.       inability of automatically answering "Y" to "Are you sure (Y/N)?"
  5432.       in a BATch operation where you are issuing a del *.*.  Actually,
  5433.       one can do this with DOS via:
  5434.             echo Y|del *.*
  5435.       and we recommend that, but it may be illuminating to discuss how to
  5436.       do this with STACKEY.   The commands
  5437.             stackey "Y"CR
  5438.             del *.*
  5439.       will not work because DOS flushes the buffer and the characters are
  5440.       lost.  Nor does
  5441.             stackey PH"Y"CR
  5442.             del *.*
  5443.       work because DOS doesn't ask for a keystroke until one is in the
  5444.       buffer.  This illustrates our point that PH only works in limited
  5445.       situations.  But
  5446.             stackey WR"Y"CR
  5447.             del *.*
  5448.       does work.  And
  5449.             stackey W18"Y"CR
  5450.             del *.*
  5451.       works properly and you can probably decrease the 18 to 7 or 8.  A
  5452.       more sophisticated method that works is
  5453.             stackey /up/"YY"CR
  5454.             del *.*
  5455.             stackey /o/
  5456.       After the flags are pUshed for later pOpping, patient mode is
  5457.       turned on.  The first Y which could be anything is flushed by DOS
  5458.       but then the second one is entered.
  5459.  
  5460.             If you have gone to command mode in a FILEKEY file and
  5461.       include a ";", the entire rest of the file will be ignored.  This
  5462.       is consistent with the STACKEY usage.  To add remarks, use $$$; and
  5463.       then remember to begin the next line with a $$ if you wish to
  5464.       remain in command mode.  Processing also halts if FILEKEY
  5465.       comes across an ASCII 0 (NOT the number 0) in your file.
  5466.  
  5467.  
  5468.       Chapter VIII:MISCELLANY                                   Page 101
  5469.  
  5470.  
  5471.  
  5472.  
  5473.                         Documentation for STACKEY, Version 4.0 
  5474.  
  5475.  
  5476.             We recommend that you include STACKEY with the default buffer
  5477.       size in your AUTOEXEC.BAT file.  If you later need a large buffer
  5478.       size, you can load a new copy with the /Rxxxx/ command.  Ideally
  5479.       you should use a program like Mark/Release to remove this second
  5480.       copy when finished in which case STACKEY will revert to using the
  5481.       original copy.
  5482.  
  5483.             You might want to also consider issuing some permanent
  5484.       palette change commands in your AUTOEXEC.BAT immediately after
  5485.       loading EGAPAL or VGAPAL.
  5486.  
  5487.             Do NOT use the version of FILEKEY distributed with STACKEY
  5488.       version 1.0-3.0 with this version of STACKEY.
  5489.  
  5490.             STACKEY finds itself in memory using the API and not the
  5491.       actual name so you can rename it to any convenient name you wish
  5492.       such as sk.com so long as the extension remains com.
  5493.  
  5494.             STACKEY's help uses a built in version of the CTRLALT
  5495.       Associates' MAKEDOC program currently under development.  This is a
  5496.       shareware program that will let you make resident or non-resident
  5497.       executable display files.  You can remove STACKEY.HLP if you are
  5498.       short for space.  When you ask STACKEY for help, it looks in the
  5499.       current directory and then throughout the path to find STACKEY.HLP
  5500.       and if it is not found, STACKEY will display an error message.
  5501.  
  5502.  
  5503.       VIII.2 Also by the same authors
  5504.  
  5505.             STACKEY was developed by Barry Simon and Richard M. Wilson.
  5506.       Simon and Wilson have formed CTRLALT Associates to market their
  5507.       software.  They are committed to the idea of shareware and both are
  5508.       founding members of the Association of Shareware Professionals.  At
  5509.       the time of this release of STACKEY, CTRLALT Associates has two
  5510.       free programs and several other program under development:
  5511.  
  5512.             CTRLALT PLUS is our flagship product extending the popular
  5513.       free program CTRLALT.  CTRLALT PLUS is expected to be released
  5514.       sometime.  It is a set of resident utilities including extensive cut
  5515.       and paste, a calendar, programmer's utilities (resident tables,
  5516.       emergency exit), two monitor support, a resident file viewer,
  5517.       dialer, calculator, color control and resident printer control.
  5518.  
  5519.  
  5520.  
  5521.  
  5522.       Chapter VIII:MISCELLANY                                   Page 102
  5523.  
  5524.  
  5525.  
  5526.  
  5527.                         Documentation for STACKEY, Version 4.0 
  5528.  
  5529.  
  5530.             CTRLALT PLUS and STACKEY/BATUTIL are shareware and can be
  5531.       registered with Support Group, Inc. (see Section I.3).
  5532.  
  5533.             BIGECHO is a simple program which allows a BATch file to
  5534.       display characters which are 8 rows by 8 columns.  Version 1.0 was
  5535.       released in September, 1986.  It is available on many BBS systems
  5536.       and from some disk vendors.  Most of its features are subsumed in
  5537.       BATUTIL.
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.  
  5575.  
  5576.       Chapter VIII:MISCELLANY                                   Page 103
  5577.  
  5578.  
  5579.  
  5580.  
  5581.                         Documentation for STACKEY, Version 4.0 
  5582.  
  5583.  
  5584.       Appendix to Chapter VIII
  5585.  
  5586.       Here is a quick summary of the STACKEY command line syntax:
  5587.  
  5588.             - ? will give help
  5589.             - _ will send the remainder of the line to standard output
  5590.             - Place text inside single or double quotes
  5591.             - F1-F0,F-,F=; S1-S0,S-,S=; A1-A0,A-,A=; C1-C0,C-,C= for
  5592.                  function keys
  5593.             - @x or (x for Alt-x where x=letter or number
  5594.             - ^x or ~x for Ctrl-x where x=letter or number
  5595.               (NOTE: @number for top row numbers; ^number for keypad)
  5596.             - LA,RA,UA,DA for arrow keys
  5597.             - PU,PD,HM,EN for Page Up/Dn, Home, End
  5598.             - IN,DE for Insert/Delete
  5599.             - N0,...,N9,N. for numeric keypad numbers and decimal point
  5600.             - G+,G-,G* or N+,N-,N* for Grey keys
  5601.             - PS for PrtSc
  5602.             - CP for Ctrl-PrtSc, CB for Ctrl-Backspace
  5603.             - TA or TB for Tab; ST or BT for Shift Tab
  5604.             - ES,BS,SP,CR for Escape, Backspace, Space, Enter
  5605.             - FF, LF for form feed (^L) and Ctrl-Enter
  5606.             - DQ,SQ for " and '
  5607.             - PH and WR for two kinds of "phony keystroke"
  5608.             - +/-N,+/-S,+/-C,+/-I to turn On/Off Num, Scroll, Caps Lock, Insert
  5609.             - SH(X,nnn) with X a subset of CALR simulates shifts for nnn ticks
  5610.             - CA invokes CTRLALT PLUS
  5611.             - Qn switches to Carousel partition n
  5612.             - Dn with n=1 or 2 invokes Desqview main menu
  5613.             - TE(idstring,keyid) for Tesseract programs
  5614.             - Z+/- clone speedup/slowdown
  5615.             - P-/+ to disable, reenable Shift-PrtScrn
  5616.             - BE for BIOS beeps
  5617.             - MP(msg), ME(msg) for popup messages
  5618.             - $x or *x for prompt metastrings with SEND extensions (see
  5619.                                       below)
  5620.             - \nnn with nnn=decimal number for Alt-keypad entry
  5621.             - Xhhhh with hhhh=hex word for direct hex entry
  5622.             - #nnn or )nnn to repeat the next keystroke nnn times
  5623.             - :nnn label (nnn=0 to 255)
  5624.             - Jnnn jump to label nnnn
  5625.             - Wnnn to insert a delay of nnn ticks (18.2 ticks = 1 sec)
  5626.             - Mnnn to insert a delay of nnn minutes
  5627.             - UNhh:mm resident until command
  5628.  
  5629.  
  5630.       Chapter VIII:MISCELLANY                                   Page 104
  5631.  
  5632.  
  5633.  
  5634.  
  5635.                         Documentation for STACKEY, Version 4.0 
  5636.  
  5637.  
  5638.             - SC(string) to scan at cursor position
  5639.             - SCn,m(string) to scan at absolute position
  5640.             - SS(string) and SSn,m(string) to scan silently
  5641.             - SJ(string1; string2;....; string n) to scan multiple strings
  5642.             - SU(string1; string2;....; string n) to scan multiple strings
  5643.                         silently
  5644.             - WB pause script until buffer is empty
  5645.             - WH pause script for restart hotkey
  5646.             - WK pause script for any key
  5647.             Convention: X=subset of CALR; Y=single keystroke like "a" or F1
  5648.             - WS(X,Y) pause for specific key
  5649.             - WJ(X1,Y1;X2,Y2;...Xn,Yn) pause for multiple hotkeys
  5650.             - H!(X,Y) resets flush buffer hotkey (default=AL,!)
  5651.             - H*(X,Y) resets flush scan hotkey (default=AL,G*)
  5652.             - H-(X,Y) resets stop hotkey (default=AL,G-)
  5653.             - H+(X,Y) resets restart hotkey (default=AL,G+)
  5654.             - CL,NL,SL,SR CapsL, NumL, ScrollL, SysReq for hotkey only
  5655.             - ! to flush buffer
  5656.             - ; to stop reading command line (for comments)
  5657.             - /Bnnnn/ to change buffer size on initial loading
  5658.             - /Rnnnn/ to force extra loading with new buffer size
  5659.             - /i/ /s/ and /p/ for impatient, patient, smart processing
  5660.             - /t/ and /n/ to turn test mode on and off
  5661.             - /c/ and /d/ to turn continue mode on and off
  5662.             - /u/ and /o/ to push and pop the s,t,c flags
  5663.             - /a/ and /e/ to set American vs European dates for $E & $d
  5664.             - /?/ to query the s,t,c flags
  5665.             - Ln to set coLors on the CGA (n=0,...,15)
  5666.             - Pn to set palette on the CGA in mode 4 (n=0,1)
  5667.             - [c=nn] to map color number nn to slot c on the EGA
  5668.             - [#m;c=nn] to do the map in the permanent table for mode m
  5669.                     #A:All palettes
  5670.                     #T:Ultravision, text modes only
  5671.                     #U:Ultravision
  5672.             - +/-B to turn blinking on/off on the EGA or VGA
  5673.             - IL(xx/xx/xx/xx)  InLine command (USE WITH CAUTION!)
  5674.             - EX(filename)  External inline (USE WITH CAUTION!)
  5675.  
  5676.       In summarizing utilities mode, minimal truncations are capitalized.
  5677.       Only use the leading capitol letter for x.
  5678.             - {BOOT} or {REBOOT} for a warm reboot
  5679.             - {BOOT=C} or {REBOOT=C} for a cold reboot
  5680.             - {MONitor=x} x=Color,Mono,Switch
  5681.             - {Prn} to switch LPT1 and LPT2
  5682.  
  5683.  
  5684.       Chapter VIII:MISCELLANY                                   Page 105
  5685.  
  5686.  
  5687.  
  5688.  
  5689.                         Documentation for STACKEY, Version 4.0 
  5690.  
  5691.  
  5692.             - {COmm} to switch COM1 and COM2
  5693.             - {CUrsor=x} x=+/- to turn standard cursor on/off
  5694.             - {CUrsor=n,m} to put cursor on scan lines n through m
  5695.             - {CPosition=n,m} to move the cursor to row n, column m
  5696.             - {MODe=n} switch to allowed video mode
  5697.             - {LInes=n} n=25,43(50) to shift modes on the EGA (VGA)
  5698.             - {LO=xy} where x is + or - and y=N,S,C or I to toggle lock keys
  5699.             - {Wait=nnn} Real time pause of nnn clock ticks; n between 1 and 32K
  5700.             - {Until=HH:MM} Real time pause until time HH:MM
  5701.             - {DUMPP} to do a screen dump to printer
  5702.             - {DUMPF=x}, {DUMPL=x} to append screen to file with filespec "x"
  5703.             - {DUMPOF=x}, {DUMPOL=x} to overwrite screen to file
  5704.             - {HALT} stops batch file with ^C
  5705.             - {Keywait}, {Enterwait} pause for input
  5706.             - {Abortwait}, {~abortwait} pause for input to abort
  5707.             - {BEep=nn,mm} nn = inverse pitch, mm = duration
  5708.  
  5709.       PROMPT metastrings and extensions:
  5710.             - $v = DOS version            - $t = time in HH:MM:SS.hh format
  5711.             - $n = current drive          - $T = time in HHMM format
  5712.             - $p = current path           - $H = hour from 0 to 23
  5713.             - $P = current path with \    - $d = date in DAY MM-DD-YYYY
  5714.             - $$ = the character $        - $M = month in MM format
  5715.             - $g = the character >        - $D = day in DD format
  5716.             - $l = the character <        - $Y = year in YY format
  5717.             - $q = the character =        - $W = day of the week
  5718.             - $h = the character bks      - $E = date in English
  5719.             - $b = the character |
  5720.             - $e = the character esc
  5721.             - $_ = CR/LF
  5722.  
  5723.       FILEKEY has the following conventions:
  5724.             -  default interprets as pure text
  5725.             -  $$ toggles between pure text and STACKEY command mode
  5726.             -  $; in text mode suppresses CR and remainder of line
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.       Chapter VIII:MISCELLANY                                   Page 106
  5739.  
  5740.  
  5741.    INDEX
  5742.  
  5743.    abortwait               75                   EGA/VGA colors          60
  5744.    Alt key combinations    19                   EGAPAL                  97
  5745.    Alt keypad              24                   enhanced keyboard       21
  5746.    API                     91                   enterwait               75
  5747.    arithmetic             100                   errorlevel              16
  5748.    Australian registration  7                   errorlevel              74
  5749.    beeps                   73                   European dates          23
  5750.    BIOS buffer             79                   extended ASCII code     81
  5751.    BIOS data area          79                   Extended ASCII codes    24
  5752.    blinking bit            63                   external code           88
  5753.    border colors           54                   file screen             73
  5754.    boxes.com               99                   filekey                 93
  5755.    Break status            51                   FILEKEY command mode    93
  5756.    British Registration     7                   flush buffer            43
  5757.    buffer overflow         16                   flush scan              43
  5758.    buffer size             52                   flushing the buffer     48
  5759.    Buffer, enlarging the   49                   forty three lines       72
  5760.    buffer, flushing        48                   Function keys           19
  5761.    buffer, keyboard        79                   halt                    75
  5762.    buffer, STACKEY's       46                   help                    16
  5763.    Caps Lock               22                   hotkeys                 43
  5764.    CAROUSEL                25                   inline code             87
  5765.    cgacolor.bat            99                   interupts               77
  5766.    CLONE SPEEDUP           26                   keyboard buffer         79
  5767.    cold reboot             74                   keywait                 75
  5768.    color codes - CGA       54                   L command               55
  5769.    color codes, EGA        58                   large buffer            50
  5770.    color.bat               99                   loading high            50
  5771.    colors on the CGA       55                   loading STACKEY         14
  5772.    colors on the EGA/VGA   60                   lock toggles            75
  5773.    com port swap           70                   loops                   38
  5774.    comments                49                   messages                27
  5775.    continue mode           51                   mode changes            71
  5776.    Control key combinations 19                  modes, graphics         53
  5777.    copyright               11                   music                   73
  5778.    Ctrl-Break              20                   normal mode             51
  5779.    CTRLALT PLUS            25                   NUL, redirection to     17
  5780.    cursor control          72                   Num Lock                22
  5781.    Cursor keys             20                   Numeric keypad          19
  5782.    date                    23                   overscan byte           59
  5783.    dates, European         23                   P command               56
  5784.    dates, European         37                   palettes, CGA           56
  5785.    delays                  38                   palettes, permanent
  5786.    DESQVIEW                25                          on the EGA/VGA   62
  5787.    directory, current      23                   palettes, temporary
  5788.    disabling print screen  71                          on the EGA/VGA   60
  5789.    disclaimer              10                   path, current           23
  5790.    discontinue mode        52                   pause script            43
  5791.    dumpf                   17                   permanent palettes
  5792.    dword1                  97                          on the EGA/VGA   62
  5793.  
  5794.  
  5795.  
  5796.    permission to copy       9
  5797.    phony keystroke         42
  5798.    pop STACKEY flags       52
  5799.    popup messages          27
  5800.    PRIMETIME               26
  5801.    print screen            71
  5802.    print screen            73
  5803.    printer swap            70
  5804.    push STACKEY flags      52
  5805.    query STACKEY flags     52
  5806.    reboot                  74
  5807.    recording scripts       94
  5808.    Registration             6
  5809.    Registration, Australian 7
  5810.    Registration, British    7
  5811.    repeats                 37
  5812.    resume script           43
  5813.    RrBbGg color labels     57
  5814.    scan                    40
  5815.    scan jump               41
  5816.    scan silently           41
  5817.    screen dumps            73
  5818.    Scroll Lock             22
  5819.    second ASCII code       81
  5820.    seecolor.bat            99
  5821.    SIDEKICK                26
  5822.    SIDEKICK PLUS           26
  5823.    site licenses            9
  5824.    SKGET                   94
  5825.    SKREC                   94
  5826.    SKRES                   50
  5827.    smart processing        46
  5828.    sounds.bat              99
  5829.    STACKEY's API           91
  5830.    swap ports              70
  5831.    temporary palettes
  5832.           on the EGA/VGA   60
  5833.    TESSERACT               25
  5834.    test mode               51
  5835.    text mode               53
  5836.    time                    23
  5837.    Two key special codes   20
  5838.    ultravision             61
  5839.    Upper ASCII codes       24
  5840.    utilities mode syntax   66
  5841.    VGAPAL                  97
  5842.    W command               67
  5843.    wait for buffer         39
  5844.    wait for hotkey         45
  5845.    wait for key            45
  5846.    wait for request        42
  5847.    wait jump               45
  5848.    waits                   39
  5849.    waits                   67
  5850.    warm reboot             74
  5851.  
  5852.  
  5853.  
  5854.